我两天前安装了 Debian。虽然安装网络没问题,但一切都正确。然而,在第一次启动时,我遇到了诸如“IP 配置不可用”、“无法连接到有线连接 1”之类的错误。我使用 USB 网络共享来写这篇文章。我不知道出了什么问题,它就这样发生了。
以下是一些有用的命令:
sudo dmesg | grep -i 'r8169'
: (r8169 是我的以太网驱动程序):
[ 3.042315] r8169 0000:04:00.0 eth0: RTL8168g/8111g, b4:2e:99:92:e0:a1, XID 4c0, IRQ 37
[ 3.042322] r8169 0000:04:00.0 eth0: jumbo features [frames: 9194 bytes, tx checksumming: ko]
[ 3.046476] r8169 0000:04:00.0 enp4s0: renamed from eth0
[ 8.827167] r8169 0000:04:00.0: firmware: direct-loading firmware rtl_nic/rtl8168g-2.fw
[ 8.852380] Generic FE-GE Realtek PHY r8169-0-400:00: attached PHY driver (mii_bus:phy_addr=r8169-0-400:00, irq=MAC)
[ 9.013339] r8169 0000:04:00.0 enp4s0: Link is Down
[ 10.581691] r8169 0000:04:00.0 enp4s0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 10.583868] r8169 0000:04:00.0 enp4s0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 56.049359] r8169 0000:04:00.0 enp4s0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 56.062246] r8169 0000:04:00.0 enp4s0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 101.049573] r8169 0000:04:00.0 enp4s0: Link is Up - 100Mbps/Full - flow control rx/tx
sudo ifconfig enp4s0
:
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether b4:2e:99:92:e0:a1 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 714 bytes 110249 (107.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
(这是在尝试连接时,但唯一的区别是额外的字节(之前是 713))。
nmcli device show enp4s0
:
GENERAL.DEVICE: enp4s0
GENERAL.TYPE: ethernet
GENERAL.HWADDR: B4:2E:99:92:E0:A1
GENERAL.MTU: 1500
GENERAL.STATE: 70 (connecting (getting IP configuration))
GENERAL.CONNECTION: Home
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/41
WIRED-PROPERTIES.CARRIER: on
IP4.GATEWAY: --
IP6.GATEWAY: --
sudo journalctl -xb
:这里
- 这个问题在 Ubuntu 上仍然存在,我已经安装了硬件的所有驱动程序和固件。
tcpdump -v -ni enp4s0
:
tcpdump: listening on enp4s0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
14:55:13.430559 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from b4:2e:99:92:e0:a1, length 300, xid 0x560a8511, Flags [none]
Client-Ethernet-Address b4:2e:99:92:e0:a1
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: Discover
Hostname (12), length 6: "Debian"
Parameter-Request (55), length 17:
Subnet-Mask (1), BR (28), Time-Zone (2), Default-Gateway (3)
Domain-Name (15), Domain-Name-Server (6), Unknown (119), Hostname (12)
Netbios-Name-Server (44), Netbios-Scope (47), MTU (26), Classless-Static-Route (121)
NTP (42), Classless-Static-Route-Microsoft (249), Static-Route (33), Unknown (252)
RP (17)
14:55:20.776321 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from b4:2e:99:92:e0:a1, length 300, xid 0x560a8511, secs 7, Flags [none]
Client-Ethernet-Address b4:2e:99:92:e0:a1
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: Discover
Hostname (12), length 6: "Debian"
Parameter-Request (55), length 17:
Subnet-Mask (1), BR (28), Time-Zone (2), Default-Gateway (3)
Domain-Name (15), Domain-Name-Server (6), Unknown (119), Hostname (12)
Netbios-Name-Server (44), Netbios-Scope (47), MTU (26), Classless-Static-Route (121)
NTP (42), Classless-Static-Route-Microsoft (249), Static-Route (33), Unknown (252)
RP (17)
14:55:27.870175 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from b4:2e:99:92:e0:a1, length 300, xid 0x560a8511, secs 14, Flags [none]
Client-Ethernet-Address b4:2e:99:92:e0:a1
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: Discover
Hostname (12), length 6: "Debian"
Parameter-Request (55), length 17:
Subnet-Mask (1), BR (28), Time-Zone (2), Default-Gateway (3)
Domain-Name (15), Domain-Name-Server (6), Unknown (119), Hostname (12)
Netbios-Name-Server (44), Netbios-Scope (47), MTU (26), Classless-Static-Route (121)
NTP (42), Classless-Static-Route-Microsoft (249), Static-Route (33), Unknown (252)
RP (17)
14:55:36.534243 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from b4:2e:99:92:e0:a1, length 300, xid 0x560a8511, secs 23, Flags [none]
Client-Ethernet-Address b4:2e:99:92:e0:a1
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: Discover
Hostname (12), length 6: "Debian"
Parameter-Request (55), length 17:
Subnet-Mask (1), BR (28), Time-Zone (2), Default-Gateway (3)
Domain-Name (15), Domain-Name-Server (6), Unknown (119), Hostname (12)
Netbios-Name-Server (44), Netbios-Scope (47), MTU (26), Classless-Static-Route (121)
NTP (42), Classless-Static-Route-Microsoft (249), Static-Route (33), Unknown (252)
RP (17)
14:55:47.137530 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from b4:2e:99:92:e0:a1, length 300, xid 0x560a8511, secs 34, Flags [none]
Client-Ethernet-Address b4:2e:99:92:e0:a1
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: Discover
Hostname (12), length 6: "Debian"
Parameter-Request (55), length 17:
Subnet-Mask (1), BR (28), Time-Zone (2), Default-Gateway (3)
Domain-Name (15), Domain-Name-Server (6), Unknown (119), Hostname (12)
Netbios-Name-Server (44), Netbios-Scope (47), MTU (26), Classless-Static-Route (121)
NTP (42), Classless-Static-Route-Microsoft (249), Static-Route (33), Unknown (252)
RP (17)
14:55:58.774372 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from b4:2e:99:92:e0:a1, length 300, xid 0xbe1cac50, Flags [none]
Client-Ethernet-Address b4:2e:99:92:e0:a1
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message (53), length 1: Discover
Hostname (12), length 6: "Debian"
Parameter-Request (55), length 17:
Subnet-Mask (1), BR (28), Time-Zone (2), Default-Gateway (3)
Domain-Name (15), Domain-Name-Server (6), Unknown (119), Hostname (12)
Netbios-Name-Server (44), Netbios-Scope (47), MTU (26), Classless-Static-Route (121)
NTP (42), Classless-Static-Route-Microsoft (249), Static-Route (33), Unknown (252)
RP (17)
答案1
尽管这听起来令人沮丧,但这不是计算机或其他任何问题的问题。令人惊讶的是,路由器本身出现了故障,不允许我的计算机获得 IP 地址!
修复它的方法相当烦人,但对我有用:
- 从字面上拔掉路由器上的所有东西以及计算机上的以太网电缆。当我所说的一切时,我指的是任何可能接触路由器的东西。
- 重新启动 NetworkManager 和网络:
sudo service networking restart && sudo service NetworkManager restart
- 请等待一两分钟,以确保确定。
- 最后,重新连接所有东西。当路由器完全启动后,尝试重新连接。在某个时刻,它应该说已成功连接。