호스트에서 게스트로의 iptables 전달은 VM 간의 통신을 방해합니다.

호스트에서 게스트로의 iptables 전달은 VM 간의 통신을 방해합니다.

내 iptables -L:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:bootps

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             192.168.122.0/24     ctstate RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             nginx                tcp dpt:http
ACCEPT     tcp  --  anywhere             nginx                tcp dpt:https

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootpc
ACCEPT     tcp  --  anywhere             anywhere

반품:

$ cat /proc/sys/net/ipv4/ip_forward
1

192.168.122.0/24에 여러 개의 VM이 있는데 그 중 하나는 80과 443을 수신하는 nginx입니다. VM이 서로 :80 및 :443을 요청하는 경우를 제외하고 모든 네트워킹은 잘 작동합니다. 심지어 FQDN(nginx에 속해야 함)의 요청도 마찬가지입니다.

답변1

이것이 "답변"에 해당하는지 모르겠지만 내 문제를 해결했습니다. 내 /etc/hosts를 편집하고 공용 IP를 내부 VM IP로 재정의하면 모든 것이 제대로 작동하기 시작했습니다. 내 생각에는 공용 IP를 통한 왕복이 끊어진 것 같지만 완전히 확실하지는 않습니다.

관련 정보