Lubuntu 16.04 - 我的新 ISP“网关/电缆调制解调器/同轴电缆”连接上没有互联网

Lubuntu 16.04 - 我的新 ISP“网关/电缆调制解调器/同轴电缆”连接上没有互联网

它是Lubuntu mini.iso,没有桌面环境,只有fvwm,所以拜托,我只能使用终端。我没有安装任何网络管理器。

有两种不同的路由器:

在 SIM 路由器上,有线互联网连接适用于 Lubuntu 设备。

一旦我将以太网电缆从该 SIM 路由器更改为仅通过电缆调制解调器(网关)仅具有电视电缆/同轴电缆连接的其他提供商(路由器),就不再有互联网连接。

使用相同的网络电缆/路由器端口(来自电视电缆/同轴电缆/网关 ISP),互联网可以在 Windows 7 和 10 上运行。

从我所看到的两个不同的路由器/连接,IP 是动态分配的。

请告诉我您需要从工作连接和非工作连接中获取哪些日志,以便查看差异...

谢谢。

有效的互联网连接(SIM 路由器):

~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 68:f7:28:21:c8:85  
          inet addr:192.168.8.100  Bcast:192.168.8.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6773 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6029 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5842607 (5.8 MB)  TX bytes:1038943 (1.0 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:7609 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7609 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:766404 (766.4 KB)  TX bytes:766404 (766.4 KB)

wlan0     Link encap:Ethernet  HWaddr ac:b5:7d:f2:ef:2f  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

非互联网工作连接(在我仅将以太网电缆从 SIM 路由器更改为另一个之后)

~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 68:f7:28:21:c8:85  
          inet addr:192.168.8.100  Bcast:192.168.8.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15580 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14234 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:11441631 (11.4 MB)  TX bytes:2455373 (2.4 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:8093 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8093 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:839056 (839.0 KB)  TX bytes:839056 (839.0 KB)

wlan0     Link encap:Ethernet  HWaddr ac:b5:7d:f2:ef:2f  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

我对 WiFi 连接不感兴趣。

两台路由器或任何 Linux/Windows 7/Windows 10 机器的配置均未更改。

只需将所有 3 个不同设备的同一根电缆从一个路由器更改为另一个路由器即可。 Windows 10 和 Windows 7 的两个路由器都有互联网连接。

Linux 仅在 SIM 路由器上有互联网。

对于从插入 Linux 以太网电缆的路由器引导的非工作互联网连接,只有橙色 LED 闪烁,但对于通过以太网电缆连接到同一路由器的其他互联网工作设备,绿色 LED 也闪烁路由器。

工作互联网连接:

~$ ping google.com
PING google.com (195.249.145.114) 56(84) bytes of data.
64 bytes from cache.google.com (195.249.145.114): icmp_seq=1 ttl=58 time=26.0 ms
64 bytes from cache.google.com (195.249.145.114): icmp_seq=2 ttl=58 time=35.6 ms
64 bytes from cache.google.com (195.249.145.114): icmp_seq=3 ttl=58 time=44.4 ms
64 bytes from cache.google.com (195.249.145.114): icmp_seq=4 ttl=58 time=43.2 ms
64 bytes from cache.google.com (195.249.145.114): icmp_seq=5 ttl=58 time=43.2 ms
64 bytes from cache.google.com (195.249.145.114): icmp_seq=6 ttl=58 time=39.4 ms
^C
--- google.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5008ms
rtt min/avg/max/mdev = 26.059/38.670/44.463/6.378 ms


~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=48.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=57.6 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=56.1 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 48.494/54.102/57.670/4.023 ms

等待/等待几分钟后 ping google.com 无法正常工作互联网连接,如下所示:

~$ ping google.com
ping: unknown host google.com

~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.8.100 icmp_seq=1 Destination Host Unreachable
From 192.168.8.100 icmp_seq=2 Destination Host Unreachable
From 192.168.8.100 icmp_seq=3 Destination Host Unreachable
From 192.168.8.100 icmp_seq=4 Destination Host Unreachable
From 192.168.8.100 icmp_seq=5 Destination Host Unreachable
From 192.168.8.100 icmp_seq=6 Destination Host Unreachable
From 192.168.8.100 icmp_seq=7 Destination Host Unreachable
From 192.168.8.100 icmp_seq=8 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
10 packets transmitted, 0 received, +8 errors, 100% packet loss, time 9026ms
pipe 3

dhcpcd eth0在连接工作互联网的情况下运行,在 dhcpcd 加载所有内容后,我将电缆插入不工作的互联网路由器,互联网工作了,也许是因为 dhcpcd 正在运行。

我重新启动了设备以查看它是否仍然可以工作,但是当重新启动后加载 Linux 时,控制台中会出现以下内容:

Failed to start LSB: IPV4 DHCP client with IPV4ALL support.
See 'systemctl status dhcpcd.service' for details
16.780656 usb 1-1.4.3: device descriptor read/64, error -110
A start job is running to Raise network interfaces ( ** min **s / 5min 7s)

最后一部分“启动作业正在运行...”,我必须等待 5 分 7 秒,每当互联网无法工作时,它就会出现。当网络可用时它从未出现,但当网络不可用时它总是出现......

在使用非工作互联网启动 Linux 后,我也尝试过,dhcpcd eth0但是......

eth0: waiting for carrier
timed out
dhcpcd exited

然后再次...

我刚刚(不少于)只是将电缆从非互联网连接路由器移至互联网工作连接路由器 dhcpcd eth0

成功加载所有内容(插入互联网连接)。将“dhcpcd eth0”的输出粘贴到此处不是一个好主意吗?

拔掉工作的互联网连接并插入非互联网连接,但令人惊讶的是,现在我从非工作的互联网连接发帖,它似乎现在正在工作,因为dhcpcd eth0

但是,如果我像上次一样重新开始,我想它会再次像以前一样发生。

一旦“等待运营商”没有触及任何其他东西,我只从Linux机器上拔下网线的头部,将其插入Windows 7机器,从Windows机器上完全禁用无线,启用LAN和互联网正在工作...这可能意味着路由器/电缆/路由器端口工作正常?

我也会尝试重置路由器...

难道是Linux的任何其他配置,考虑到我在dhcpcd eth0插入可上网的路由器后使用互联网,然后插入非互联网路由器仍然有互联网连接......(直到重新启动)


互联网在非互联网工作路由器中工作的唯一方式(相同的网络电缆/相同的路由器端口,一切都与不工作时相同)是dhcpcd eth0当网络电缆插入工作互联网路由器时以及之后仅将电缆从工作互联网路由器移动到非工作互联网路由器。

但如果我重新启动机器,没有互联网,直到我不会重复之前的步骤。

我还重置了几次路由器,重新启动它(拔掉电源至少 30 秒)尝试用另一个有线路由器将 Linux 机器重新连接到非互联网路由器,也连接到另一个端口路由器,但是仍然不起作用,直到我不再从头开始执行该步骤。

当插入另一台 Windows 7 和 Windows 10 计算机时,来自非互联网路由器的相同以太网电缆和路由器端口可立即提供互联网,而无需更改 Windows 或全新/新/从头开始重置路由器中的任何内容。

uname -a
Linux WindowsXP 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:    16.04
Codename:   xenial

这是/var/log/dmesg

https://paste.debian.net/hidden/8226e135/

以下所有命令都是在互联网工作的情况下输出的(连接到通常非互联网的路由器,直到我不会执行本重播开头的步骤)

lshw -C network  *-network DISABLED      
       description: Wireless interface
       product: QCA9565 / AR9565 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 01
       serial: ac:b5:7d:f2:ef:2f
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=4.4.0-78-generic firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11bgn
       resources: irq:18 memory:90500000-9057ffff memory:90580000-9058ffff
  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: eth0
       version: 10
       serial: 68:f7:28:21:c8:85
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168g-3_0.0.1 04/23/13 ip=192.168.110.11 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       resources: irq:88 ioport:1000(size=256) memory:90404000-90404fff memory:90400000-90403fff

more /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 208.67.222.222
nameserver 208.67.220.220
nameserver 192.168.8.1

route 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.110.1   0.0.0.0         UG    202    0        0 eth0
192.168.110.0   *               255.255.255.0   U     202    0        0 eth0

var/log/kern.log 太大了,无法粘贴到任何地方,我不知道为什么我无法将该文件上传到任何文件托管站点、Google 驱动器或其他地方。文件只有2.1M。我也尝试过复制/重命名它,但无法将其上传到任何地方。甚至在论坛上作为文件附件。可能是因为文件内容。


考虑到之前的帖子,当我通过定期/通常不工作的互联网路由器连接到互联网时,但这一次,在重新启动之前,互联网正在工作(您可以在开头看到工作互联网连接的原因之前的帖子)

我只是重新启动了机器,没有碰其他任何东西,路由器、电缆或其他任何东西。

重启后立即:

~$ ping google.com
ping: unknown host google.com

~$ ping 8.8.8.8
connect: Network is unreachable

~$ sudo dhcpcd eth0
[sudo] password for globalisation: 
eth0: waiting for carrier
timed out
dhcpcd exited

从上面的帖子/重播来看,192.168.110.0是网关,看来这是正确的,因为当我在浏览器中写入时,它会要求输入调制解调器/密码的用户名和密码

ping 192.168.110.1
connect: Network is unreachable
globalisation@WindowsXP:~$ ping 192.168.110.0
connect: Network is unreachable
globalisation@WindowsXP:~$ ping 192.168.8.1
connect: Network is unreachable
globalisation@WindowsXP:~$ ping 8.8.8.8
connect: Network is unreachable
globalisation@WindowsXP:~$ ping google.com
ping: unknown host google.com

:~$ dmesg |grep eth[0-9]
[    2.981426] r8169 0000:03:00.0 eth0: RTL8168g/8111g at 0xffffc90000768000, 68:f7:28:21:c8:85, XID 10900800 IRQ 88
[    2.981432] r8169 0000:03:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
[   15.883064] r8169 0000:03:00.0 eth0: link down
[   15.883066] r8169 0000:03:00.0 eth0: link down

:~$ sudo lshw -C network
  *-network DISABLED      
       description: Wireless interface
       product: QCA9565 / AR9565 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 01
       serial: ac:b5:7d:f2:ef:2f
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=4.4.0-78-generic firmware=N/A latency=0 link=no multicast=yes wireless=IEEE 802.11bgn
       resources: irq:18 memory:90500000-9057ffff memory:90580000-9058ffff
  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: eth0
       version: 10
       serial: 68:f7:28:21:c8:85
       size: 10Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168g-3_0.0.1 04/23/13 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:88 ioport:1000(size=256) memory:90404000-90404fff memory:90400000-90403fff

:~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 68:f7:28:21:c8:85  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1761 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1761 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:130352 (130.3 KB)  TX bytes:130352 (130.3 KB)


wlan0     Link encap:Ethernet  HWaddr ac:b5:7d:f2:ef:2f  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

:~$ more /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 208.67.222.222
nameserver 208.67.220.220

:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

经常不上网的路由器上的互联网工作连接:

:~$ ethtool eth0
Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Half 1000baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                         100baseT/Half 100baseT/Full 
                                         1000baseT/Full 
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
    Current message level: 0x00000033 (51)
                   drv probe ifdown ifup
    Link detected: yes

对于上述相同的非互联网工作路由器,没有互联网(因为重新启动)。未检测到链接,但同一电缆/机器/端口在重新启动之前具有互联网...

:~$ ethtool eth0
Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Half 1000baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                         100baseT/Half 100baseT/Full 
                                         1000baseT/Full 
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
    Current message level: 0x00000033 (51)
                   drv probe ifdown ifup
    Link detected: yes

始终互联网工作的路由器(完全是另一个提供商,另一个连接,另一个路由器)

:~$ ethtool eth0
Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Half 1000baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                         100baseT/Half 100baseT/Full 
    Link partner advertised pause frame use: Symmetric
    Link partner advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
    Current message level: 0x00000033 (51)
                   drv probe ifdown ifup
    Link detected: yes

问候。

答案1

看来这两个命令解决了问题:

sudo ethtool -s eth0 autoneg off speed 100 duplex full

sudo dhcpcd eth0

只是现在,还得弄清楚它们如何能够在系统启动时运行,因为每次重启后都要使用这两个命令。

看来将它们添加到 /etc/rc.local 中没有任何效果。

启动时仍然存在以下 3 个问题:

[FAILED] Failed to start LSB: IPV4 DHCP client with IPV4LL support
[17.289877] usb 1-1.4.3: device descriptor read/64, error -110
A start job is running for Raise network interfaces (**min **s / 5min 8s)

并且在5分8秒过去之前还有等待时间。仅当无法识别互联网连接时,才会出现最后一个错误,但当互联网连接在重新启动后立即开始工作且无需使用任何命令来启动互联网时,则永远不会出现。

答案2

直接运行dhcpcd与网络配置系统冲突。 (在您的情况下,网络配置位于/etc/network/interfaces或中/etc/network/interfaces.d)。通常您只需要dhcpcd出于测试目的而调用。

为了避免与 Debian 网络配置系统发生冲突,请ifdown eth0在测试之前使用dhcpcd.

Debian 网络配置系统ifupdown预计不会响应链接状态(电缆拔出并重新插入)。如果您需要此功能,NetworkManager 可以提供。 NetworkManager 的工作方式还可以避免在网络无法启动时阻塞整个启动过程。否则,要切换网络,您必须

  1. ifdown eth0- 首先执行此操作以避免与新网络上的另一台计算机造成地址冲突!
  2. 开关电缆
  3. ifup eth0

最后,从您的回答来看,您似乎已经发现了一个异常硬件问题的解决方法(指向 r8169 = 便宜的 RealTek 芯片),您希望在ifupdown为您启动 DHCP 客户端之前运行该解决方法。编辑/etc/network/interfaces包含您的网络配置的文件。紧接该行之后

iface eth0 inet dhcp

添加

 pre-up ethtool -s eth0 autoneg off speed 100 duplex full

前导空格/缩进是惯例,但不是必需的。

为了确保这些命令确实运行,您可以使用logger.请注意,我已使用 ethtool 修改了该行,并在前后添加了行。

 pre-up logger -- running ethtool...
 pre-up ethtool -s eth0 autoneg off speed 100 duplex full 2>&1 | logger
 pre-up logger -- finished running ethtool

日志行应该出现在系统日志中(例如journalctl -b),其中包含来自 ethtool 的任何输出,后面是来自 的消息dhclient。如果 ethtool 没有输出,则认为已成功。我相信日志消息也会被转发到您的持久系统日志文件(/var/log/messages 或 /var/log/syslog ?)。

为了避免测试时出现五分钟的延迟,您可以首先注释掉该auto eth0行(在开头添加 # 以禁用它)。然后计算机将启动,而不会尝试提升eth0接口,您可以ifup手动运行看看是否有效。尽管遗憾的是它可能以这种方式工作,但由于一些令人讨厌的计时问题而不能在启动期间工作。

Google 搜索表明 NetworkManager 不会实施 pre-up。不幸的是,如果您想切换到 NetworkManager,则必须进入 systemd 并创建一个服务。可能需要命令该服务在 NetworkManager 之前运行。

答案3

看来最终的结果是,为了在重新启动/关闭/睡眠后自动访问互联网,而无需更多手动命令:

/etc/网络/接口

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
iface eth0 inet dhcp
    pre-up ethtool -s eth0 autoneg off speed 100 duplex full

allow-hotplug eth0

/etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

echo 70 > /sys/class/backlight/intel_backlight/brightness
rfkill block bluetooth
rfkill block wifi
ethtool -s eth0 autoneg off speed 100 duplex full
ip link set eth0 up

exit 0

相关内容