![호스트에서 게스트로의 iptables 전달은 VM 간의 통신을 방해합니다.](https://linux55.com/image/73723/%ED%98%B8%EC%8A%A4%ED%8A%B8%EC%97%90%EC%84%9C%20%EA%B2%8C%EC%8A%A4%ED%8A%B8%EB%A1%9C%EC%9D%98%20iptables%20%EC%A0%84%EB%8B%AC%EC%9D%80%20VM%20%EA%B0%84%EC%9D%98%20%ED%86%B5%EC%8B%A0%EC%9D%84%20%EB%B0%A9%ED%95%B4%ED%95%A9%EB%8B%88%EB%8B%A4..png)
내 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를 통한 왕복이 끊어진 것 같지만 완전히 확실하지는 않습니다.