快速实现虚拟机上网:
物理机(ip:172.25.50.250):
iptables -t nat -A POSTROUTING -s 172.25.50.0/24 -j MASQUERADE #配置火墙策略
虚拟机(ip:172.25.50.1):
route add default gw 172.25.50.250 #添加默认网关
route -n #查看路由
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.25.50.250 0.0.0.0 UG 0 0 0 eth0
172.25.50.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
vim /etc/resolv.conf
nameserver 114.114.114.114