我有个问题。首先,我要在Ubuntu 14.04上设置服务器。我有2个接口:eth0(用于dhcp服务器)和eth1(用于互联网连接)。但是,如果我同时连接到两个网络,则PC上没有互联网。因此,我必须在服务器和Internet之间进行选择。太可怕了,谁能告诉我如何解决这个问题?
/ etc / network / interfaces:
auto lo eth0 eth1
iface lo inet loopback
iface eth0 inet static
address 172.16.1.100
netmask 255.255.255.0
broadcast 172.16.1.255
gateway 172.16.1.254
sudo路由输出:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 1 0 0 eth1
UPD:ifconfig输出:
eth0 Link encap:Ethernet HWaddr 90:e6:ba:46:1d:50
inet6 addr: fe80::92e6:baff:fe46:1d50/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1110 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:184287 (184.2 KB)
eth1 Link encap:Ethernet HWaddr 00:04:75:98:5f:da
inet addr:192.168.0.101 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::204:75ff:fe98:5fda/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14498 errors:0 dropped:0 overruns:2 frame:0
TX packets:13096 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9710708 (9.7 MB) TX bytes:1840400 (1.8 MB)
Interrupt:18 Base address:0x4c00
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4398 errors:0 dropped:0 overruns:0 frame:0
TX packets:4398 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:527890 (527.8 KB) TX bytes:527890 (527.8 KB)
nmcli dev status
还可以吗ping 192.168.0.1
?