0
게스트 네트워킹에 NAT 모드를 사용하고 있습니다. 내 컴퓨터가 게스트 외부에서 액세스 할 수 있어야합니다. iptables를 설정하여 호스트의 특정 포트를 게스트의 포트 22로 포워딩했지만 작동하지 않습니다. KVM/QEMU를 사용하는 NAT의 포트 전달
나는이 규칙을 추가 :# Port Forwardings
-A PREROUTING -i eth0 -p tcp --dport 9867 -j DNAT --to-destination 192.168.122.136:22
# Forward traffic through eth0 - Change to match you out-interface
-A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
때 나는 그것이 완벽하게 작동 내가 ssh 192.168.122.136 -p 9867
을하려고 할 때, 그러나 그것은 내가 사용 /etc/ufw/sysctl.conf
에 포트 포워딩을 설정 한 ssh: connect to host 192.168.122.1 port 9867: Connection refused
보여줍니다 호스트에서 ssh 192.168.122.136
iptables -t nat -L
은 iptable에 규칙이 설정되었음을 보여줍니다.
DNAT tcp -- anywhere anywhere tcp dpt:9867 to:192.168.122.136:22