kvm 主机上iptables 使用端口映射出虚拟机的端口
第一条:清理了所有规则
第二条:重启kvm的规则
systemctl restart iptables
systemctl restart libvirtd
虚拟机ip: 192.168.100.11 网关:92.168.100.1
主机ip: 不需要
iptables -I INPUT -p tcp --dport 8022 -j ACCEPT
iptables -I FORWARD -m state -d 192.168.100.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -I PREROUTING -p tcp --dport 8022 -j DNAT --to-destination 192.168.100.11:22
发现虚拟机不能联网!!!!