我有个问题。首先,我想在 Ubuntu 14.04 上设置服务器。我有 2 个接口:用于 dhcp 服务器的 eth0 和用于 Internet 连接的 eth1。但是如果我同时连接到两个网络,PC 上就没有互联网。所以我必须在服务器和互联网之间做出选择。太可怕了,谁能告诉我如何关闭这个问题?
/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
Run Code Online (Sandbox Code Playgroud)
须藤路线输出:
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
Run Code Online (Sandbox Code Playgroud)
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 …Run Code Online (Sandbox Code Playgroud)