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

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

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

有两种不同的路由器:在模拟路由器上,有线互联网连接适用于 Lubuntu 设备。

当我将以太网电缆从上述 SIM 路由器更改为仅通过电缆模型(网关)具有电视电缆/同轴电缆连接的其他提供商(路由器)时,立即就没有互联网连接了。

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

据我所见,两个不同的路由器/连接 IP 是动态的。

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

谢谢。

有效的互联网连接:

~$ 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)

非互联网工作连接(我刚将以太网电缆从一个路由器更换到另一个路由器后立即)

~$ 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 连接不感兴趣。

有两种不同的路由器:

一个通过 SIM 卡连接到互联网 - 一个 ISP(Linux 有互联网)第二个 ISP 通过同轴电缆/电视电缆/网关/调制解调器电缆连接到互联网。(这个 Linux 上没有互联网)

这两个路由器或任何机器 Linux/Windows 7/Windows 10 的配置都没有更改。

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

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

对于与插入 Linux 以太网电缆的路由器的链接指示灯不工作的互联网连接,只有橙色指示灯闪烁,但对于通过以太网电缆连接到同一路由器的其他互联网工作设备,路由器上的绿色指示灯也会闪烁。

有效的互联网连接:

~$ 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 eht0”的输出粘贴到这里不是一个好主意吗?

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

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

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

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

可能是 Linux 的其他配置有问题,考虑到我使用dhcpcd eth0插入可上网的路由器后互联网就可以工作,之后,插入非上网的路由器后仍然可以连接互联网...(直到重新启动)


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

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

我也重置了路由器几次,重新启动了它(拔掉电源至少 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 Drive 或其他地方。该文件只有 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

这似乎是最终的结果,为了在重启/关机/睡眠后自动访问互联网,不再需要手动命令:

/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

相关内容