为什么更换主板后无法上网?

为什么更换主板后无法上网?

我的旧电脑使用 H81M 主板已经有 8 年了,安装了双操作系统——win10 和 debian,今天我买了一块新的 M81H 主板(相同的 H81M 板,不同品牌)并替换旧的。
网络结构:调制解调器+路由器。
重启电脑,进入win10,就可以正常上网了。
重启电脑,进入debian,无法连接互联网。

lspci |grep -i  Ethernet
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
lspci -v
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
    Subsystem: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller
    Flags: bus master, fast devsel, latency 0, IRQ 25
    I/O ports at e000 [size=256]
    Memory at f7c04000 (64-bit, non-prefetchable) [size=4K]
    Memory at f7c00000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: r8168
    Kernel modules: r8168

sudo systemctl status wicd
#It is in good status.
lsmod |grep 816
r8168 
 
cat  /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

如何修复它?

sudo  dmesg |grep  8168
[    0.220354] pci 0000:01:00.0: [10ec:8168] type 00 class 0x020000
[    1.225031] r8168: loading out-of-tree module taints kernel.
[    1.225284] r8168: module verification failed: signature and/or required key missing - tainting kernel
[    1.226698] r8168 Gigabit Ethernet driver 8.048.03-NAPI loaded
[    1.284376] r8168: This product is covered by one or more of the following patents: US6,570,884, US6,115,776, and US6,327,625.
[    1.286372] r8168  Copyright (C) 2020  Realtek NIC software team <[email protected]> 
[    1.293220] r8168 0000:01:00.0 enp1s0: renamed from eth0

ip address
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: enp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 48:f3:17:00:36:2d brd ff:ff:ff:ff:ff:ff 

答案1

我的网卡被称为enp1s0“替代”eth0或其他名称。

ip address
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: enp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 48:f3:17:00:36:2d brd ff:ff:ff:ff:ff:ff 

我在配置文件中替换eth0为:enp1s0

sudo vim  /etc/network/interfaces
auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet dhcp

重新启动并成功连接互联网。

相关内容