|

楼主 |
发表于 2017-5-4 23:27:45
|
显示全部楼层
现在通过:
iface eth0 inet static
。。。。
iface eth0:1 inet static
iface eth0:2 inet static
的方式可以添加多个IP,但通过
iface vmbr0 inet static
address 192.168.0.1
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o eth0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o eth0 -j MASQUERADE
这方式,只有主IP有效,小鸡不能通过除主IP外的IP上网.
主机和小鸡间可以互ping,请教了! |
|