我的机器有 1 个内置以太网端口,我还插入了一个 USB 以太网适配器。看起来 Linux 正确识别了新设备,但它没有 IP 地址。
以下是 的输出ifconfig
:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.203.47 netmask 255.255.255.0 broadcast 192.168.203.255
inet6 fe80::a5d:1df2:bcb0:eb9e prefixlen 64 scopeid 0x20<link>
ether e4:5f:01:df:77:92 txqueuelen 1000 (Ethernet)
RX packets 14340 bytes 2287405 (2.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10415 bytes 6577080 (6.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether f8:e4:3b:9f:e7:d6 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1033 bytes 112633 (109.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1033 bytes 112633 (109.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
以下是 的输出ip addr
:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether e4:5f:01:df:77:92 brd ff:ff:ff:ff:ff:ff
inet 192.168.203.47/24 brd 192.168.203.255 scope global dynamic noprefixroute eth0
valid_lft 8638252sec preferred_lft 7558252sec
inet6 fe80::a5d:1df2:bcb0:eb9e/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether e4:5f:01:df:77:93 brd ff:ff:ff:ff:ff:ff
6: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether f8:e4:3b:9f:e7:d6 brd ff:ff:ff:ff:ff:ff
以下是 的输出route
:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.203.1 0.0.0.0 UG 202 0 0 eth0
192.168.203.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
我需要做什么才能启用eth1
?
编辑
我尝试拔掉内置接口 ( eth0
) 的连接,只插入 的电缆eth1
。这使我获得了该接口的 IP 地址,现在两个接口都有 IP 地址。但问题仍然存在,如何在不拔掉电缆的情况下强制执行此行为?
更新
当我把所有东西都插上电源开机前然后我让两个接口都工作了。所以似乎启动顺序中有些东西也能正确处理适配器。唯一似乎不起作用的情况是当我插入适配器时另一个接口已经连接并正常工作。