解决方法:1,设定eth0做lan,sudo vi /etc/network/interfacesauto eth0iface eth0 inet staticaddress 192.168.10.1netmask 255.255.255.02,设定eth1做wan,dhcp.auto eth1iface eth1 inet dhcp3,设定一条NAT rule,加入到/etc/rc.local文件中.iptables -Fiptables -P INPUT ACCEPTiptables -P FORWARD ACCEPTiptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth1 -j SNAT MASQUERADE4,开启IP转发修改/etc/sysctl.conf,取消这一行的注释: net.ipv4.ip_forward= 1然后使之立即生效sudo sysctl -p