还是国际站的资料多。
rgl2020
September 4th, 2008, 12:36 AM
Yeah, I found the information in the Community Documentation.
https://help.ubuntu.com/community/KVM?h ... )|(bridge)
This was taken from it:
iptables
Add these rules to iptables :
# allow incoming packets for kvm guest
-A FORWARD -d $IPADDR_FROM_GUEST_OS -j ACCEPT
# allow outgoing packets from kvm
-A FORWARD -s $IPADDR_FROM_GUEST_OS -j ACCEPT
Change "$IPADDR_FROM_GUEST_OS" to the actual ip address of the kvm guest (I advise you configure your guests to have a static IP address).
If you use ufw, add these rules to /etc/ufw/before.rules
就是说,在 /etc/ufw/before.rules里加上下面两条规则就可以:
-A FORWARD -d $IPADDR_FROM_GUEST_OS -j ACCEPT
-A FORWARD -s $IPADDR_FROM_GUEST_OS -j ACCEPT
用你虚拟机的IP替换掉$IPADDR_FROM_GUEST_OS
经过实验,确实可以,贴在这里供有需要的人查询吧。