服務器是ubuntu server 12.04 i386,裝有雙網卡。其中eth0連接到外網,eth1連接到路由器的WAN端口。想創建一個共享wifi,使其他設備都能通過服務器上網
cat /etc/network/interfaces
auto lo
iface lo inet loopback
#连接到外网
auto eth0
iface eth0 inet static
address 212.114.20.78
netmask 255.255.255.0
gateway 212.114.20.126
dns-nameservers 212.114.0.242 8.8.8.8
#连接到路由器
auto eth1
iface eth1 inet static
address 192.168.1.254
netmask 255.255.255.0
route -n
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 212.114.20.126 0.0.0.0 UG 100 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
212.114.20.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
另,你伺服器的路由表是什麼(
route -n
輸出)。