Ubuntu 22.04 激活网络连接失败

Ubuntu 22.04 激活网络连接失败

我尝试了找到的所有方法,但没有任何效果。

我尝试使用的连接是有线以太网,电缆连接到墙上的插座,再连接到 tp-link tl-sg108,后者从 TIM HUB+ ZTE H388X 获得连接。该系统与 Windows 10 是双启动的,在那里运行良好,虽然不确定这是否只是巧合,在 Ubuntu Steam 停止工作后我第一次切换回来时警告其服务未运行,我必须将其设置为在启动时自动加载。之后我回到了 Ubuntu,尝试了一堆修复,但都没有用,我恢复了更改,重新启动,它又恢复了工作,直到我切换回 Windows 并回到 Ubuntu,之后就再也没用了。每次我回到 Windows 时,时间都会调慢 2 小时,我需要禁用并重新启用自动时间,Ubuntu 可以自行管理,只是现在它没有连接,例如在 grep 中,syslog有些条目比一些较晚的条目早 2 小时,因为我注意到时间在晚上 11 点后的某个时间点不对。主板是华硕 Sabertooth Z87,因此网卡是 I217-V。在 Ubuntu 上,连接工作正常了几个星期,今天才开始不工作。

在路由器上我尝试过:

  • 重新启动以便重置 DHCP 租约,以防租约仅在 Windows 上可用(如果在 Windows 上获得)

在 Windows 上:

  • 禁用快速启动;
  • 禁用局域网唤醒;

在 Ubuntu 上我尝试过:

  • 通过设置为 true managed 来告诉 NetworkManager 管理所有连接/etc/NetworkManager/NerworkManager.conf
  • 在同一个文件中设置 dhcp 客户端,包括 internal、dhclient、dhcpcd;
  • netplan 有一行告诉它让 NetworkManaged 进入它的东西 /etc/netplan/01-network-manager-all.yaml
  • 重新启动 NetworkManagessudo service NetworkManager restartsudo systemctl restart NetworkManager
  • 在 创建一个空文件 /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
  • 手动设置IP、掩码、网关;
  • /var/lib/dhcp/dhclient.leases是空的;
  • /var/lib/dhcpcd只有无线dhcp租约文件和 secret文件;

通过运行,sudo dhcpcd -T eno1我有时看到它设法获取 IPv6,它实际上用它来连接,但只是说它已连接。Ping 没有得到回复,ping 后检查 arp 只显示<incomplete>在地址中,这意味着它没有得到任何回复。dhclient 也挂起了。

我还没有尝试过:这个人没有明确解释他做了什么在 19.04 中无法通过 DHCP 获取 IP,但如果使用 Windows,则可以获取

现在来看看常见的命令输出

sudo lshw -C network

  *-network                 
   description: Ethernet interface
   product: Ethernet Connection I217-V
   vendor: Intel Corporation
   physical id: 19
   bus info: pci@0000:00:19.0
   logical name: eno1
   version: 04
   serial: 74:d0:2b:2c:b0:a4
   size: 1Gbit/s
   capacity: 1Gbit/s
   width: 32 bits
   clock: 33MHz
   capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
   configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=5.15.0-37-generic duplex=full firmware=0.13-4 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
   resources: irq:28 memory:ef300000-ef31ffff memory:ef339000-ef339fff ioport:f040(size=32)
  *-network
   description: Wireless interface
   physical id: 9
   bus info: usb@3:6
   logical name: wlxc4e90a0658cc
   serial: c4:e9:0a:06:58:cc
   capabilities: ethernet physical wireless
   configuration: broadcast=yes driver=rtl8xxxu driverversion=5.15.0-37-generic firmware=N/A ip=192.168.1.3 link=yes multicast=yes wireless=IEEE 802.11

systemctl status NetworkManager(我最后手动禁用了连接以免干扰 USB wifi)

● NetworkManager.service - Network Manager
 Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
 Active: active (running) since Sat 2022-06-11 01:56:01 CEST; 13min ago
   Docs: man:NetworkManager(8)
Main PID: 1001 (NetworkManager)
  Tasks: 3 (limit: 38371)
 Memory: 12.1M
    CPU: 640ms
 CGroup: /system.slice/NetworkManager.service
         └─1001 /usr/sbin/NetworkManager --no-daemon
giu 11 02:04:03 Phantom NetworkManager[1001]: <info>  [1654905843.1941] manager: NetworkManager state is now CONNECTED_LOCAL
giu 11 02:04:03 Phantom NetworkManager[1001]: <info>  [1654905843.1944] device (wlxc4e90a0658cc): Activation: successful, device activated.
giu 11 02:04:05 Phantom NetworkManager[1001]: <info>  [1654905845.5149] dhcp4 (wlxc4e90a0658cc): state changed new lease, address=192.168.1.3
giu 11 02:04:05 Phantom NetworkManager[1001]: <info>  [1654905845.5155] manager: NetworkManager state is now CONNECTED_SITE
giu 11 02:04:05 Phantom NetworkManager[1001]: <info>  [1654905845.5157] policy: set 'TIM-19358435' (wlxc4e90a0658cc) as default for IPv4 routing and DNS
giu 11 02:04:09 Phantom NetworkManager[1001]: <info>  [1654905849.7524] manager: NetworkManager state is now CONNECTED_GLOBAL
giu 11 02:04:24 Phantom NetworkManager[1001]: <info>  [1654905864.5081] device (eno1): state change: activated -> deactivating (reason 'user-requested', sys-iface-state: 'managed')
giu 11 02:04:24 Phantom NetworkManager[1001]: <info>  [1654905864.5098] audit: op="device-disconnect" interface="eno1" ifindex=2 pid=2467 uid=1000 result="success"
giu 11 02:04:24 Phantom NetworkManager[1001]: <info>  [1654905864.5220] device (eno1): state change: deactivating -> disconnected (reason 'user-requested', sys-iface-state: 'managed')
giu 11 02:04:24 Phantom NetworkManager[1001]: <info>  [1654905864.5392] dhcp4 (eno1): canceled DHCP transaction

systemctl status dhcpcd

● dhcpcd.service - DHCP Client Daemon
 Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; vendor preset: enabled)
 Active: active (running) since Sat 2022-06-11 01:56:00 CEST; 1h 13min ago
   Docs: man:dhcpcd(8)
Process: 1002 ExecStart=/usr/sbin/dhcpcd (code=exited, status=0/SUCCESS)
Main PID: 1100 (dhcpcd)
  Tasks: 1 (limit: 38371)
 Memory: 1.5M
    CPU: 324ms
 CGroup: /system.slice/dhcpcd.service
         └─1100 /usr/sbin/dhcpcd

giu 11 02:41:10 Phantom dhcpcd[1100]: eno1: Router Advertisement from fe80::9a00:6aff:fea6:7a30
giu 11 02:41:10 Phantom dhcpcd[1100]: wlxc4e90a0658cc: Router Advertisement from fe80::9a00:6aff:fea6:7a30
giu 11 02:47:02 Phantom dhcpcd[1100]: eno1: Router Advertisement from fe80::9a00:6aff:fea6:7a30
giu 11 02:47:02 Phantom dhcpcd[1100]: wlxc4e90a0658cc: Router Advertisement from fe80::9a00:6aff:fea6:7a30
giu 11 02:56:07 Phantom dhcpcd[1100]: eno1: Router Advertisement from fe80::9a00:6aff:fea6:7a30
giu 11 02:56:07 Phantom dhcpcd[1100]: wlxc4e90a0658cc: Router Advertisement from fe80::9a00:6aff:fea6:7a30
giu 11 03:01:27 Phantom dhcpcd[1100]: eno1: Router Advertisement from fe80::9a00:6aff:fea6:7a30
giu 11 03:01:27 Phantom dhcpcd[1100]: wlxc4e90a0658cc: Router Advertisement from fe80::9a00:6aff:fea6:7a30
giu 11 03:04:03 Phantom dhcpcd[1100]: eno1: Router Advertisement from fe80::9a00:6aff:fea6:7a30
giu 11 03:04:03 Phantom dhcpcd[1100]: wlxc4e90a0658cc: Router Advertisement from fe80::9a00:6aff:fea6:7a30

sudo lspci -nnk

00:19.0 Ethernet controller [0200]: Intel Corporation Ethernet Connection I217-V [8086:153b] (rev 04)
DeviceName:  Onboard LAN
Subsystem: ASUSTeK Computer Inc. Ethernet Connection I217-V [1043:859f]
Kernel driver in use: e1000e

ip -6 neigh show

fe80::9a00:6aff:fea6:7a30 dev wlxc4e90a0658cc lladdr 98:00:6a:a6:7a:30 router STALE
fe80::9a00:6aff:fea6:7a30 dev eno1 lladdr 98:00:6a:a6:7a:30 router STALE

ip -4 neigh show

192.168.1.11 dev wlxc4e90a0658cc  FAILED
192.168.1.1 dev wlxc4e90a0658cc lladdr 98:00:6a:a6:7a:30 REACHABLE

nmcli

wlxc4e90a0658cc: connected to TIM-19358435
    "D-Link DWA-131 Nano"
    wifi (rtl8xxxu), C4:E9:0A:06:58:CC, hw, mtu 1500
    ip4 default
    inet4 192.168.1.3/24
    route4 192.168.1.0/24 metric 303
    route4 default via 192.168.1.1 metric 303
    route4 default via 192.168.1.1 metric 600
    inet6 fe80::9990:2313:9f3a:28ce/64
    inet6 fe80::29e5:3afd:ce7b:9742/64
    route6 fe80::/64 metric 1024
    route6 fe80::/64 metric 256

eno1: connected to Wired connection 1
    "Intel I217-V"
    ethernet (e1000e), 74:D0:2B:2C:B0:A4, hw, mtu 1500
    inet6 fe80::48c6:f95d:829c:925d/64
    route6 fe80::/64 metric 1024

lo: unmanaged
    "lo"
    loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

DNS configuration:
    servers: 192.168.1.1
    domains: home
    interface: wlxc4e90a0658cc

    servers: fe80::9a00:6aff:fea6:7a30
    interface: wlxc4e90a0658cc

Use "nmcli device show" to get complete information about known devices and
"nmcli connection show" to get an overview on active connection profiles.

Consult nmcli(1) and nmcli-examples(7) manual pages for complete usage details.

nmcli device show

GENERAL.DEVICE:                         wlxc4e90a0658cc
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         C4:E9:0A:06:58:CC
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     TIM-19358435
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/9
IP4.ADDRESS[1]:                         192.168.1.3/24
IP4.GATEWAY:                            192.168.1.1
IP4.ROUTE[1]:                           dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 303
IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 192.168.1.1, mt = 303
IP4.ROUTE[3]:                           dst = 0.0.0.0/0, nh = 192.168.1.1, mt = 600
IP4.DNS[1]:                             192.168.1.1
IP4.DOMAIN[1]:                          home
IP6.ADDRESS[1]:                         fe80::9990:2313:9f3a:28ce/64
IP6.ADDRESS[2]:                         fe80::29e5:3afd:ce7b:9742/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 1024
IP6.ROUTE[2]:                           dst = fe80::/64, nh = ::, mt = 256
IP6.DNS[1]:                             fe80::9a00:6aff:fea6:7a30

GENERAL.DEVICE:                         eno1
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         74:D0:2B:2C:B0:A4
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     Wired connection 1
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/13
WIRED-PROPERTIES.CARRIER:               on
IP4.GATEWAY:                            --
IP6.ADDRESS[1]:                         fe80::48c6:f95d:829c:925d/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 1024

GENERAL.DEVICE:                         lo
GENERAL.TYPE:                           loopback
GENERAL.HWADDR:                         00:00:00:00:00:00
GENERAL.MTU:                            65536
GENERAL.STATE:                          10 (unmanaged)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
IP4.ADDRESS[1]:                         127.0.0.1/8
IP4.GATEWAY:                            --
IP6.ADDRESS[1]:                         ::1/128
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = ::1/128, nh = ::, mt = 256

nmcli con show

NAME                UUID                                  TYPE      DEVICE          
TIM-19358435        6c09dd30-1f42-40ae-a76a-24e0e9f43f0e  wifi      wlxc4e90a0658cc 
Wired connection 1  ea97f513-3101-44a4-98a9-4cebaea410ae  ethernet  eno1

nmcli con show "Wired connection 1"

https://pastebin.com/VrLsjVwq

sudo dhcpcd -T eno1

DUID 00:04:41:9d:bf:20:d7:da:11:dd:ae:ff:74:d0:2b:2c:b0:a4
eno1: IAID 2b:2c:b0:a4
eno1: soliciting an IPv6 router
eno1: soliciting a DHCP lease
eno1: probing for an IPv4LL address
eno1: using IPv4LL address 169.254.230.155
interface='eno1'
pid='9102'
protocol='dhcp'
reason='TEST'
ifcarrier='up'
ifflags='4163'
ifmtu='1500'
ifwireless='0'
dhcpcd exited

arp -a -v

? (192.168.1.11) at <incomplete> on wlxc4e90a0658cc
H388X.home (192.168.1.1) at 98:00:6a:a6:7a:30 [ether] on wlxc4e90a0658cc
Entries: 2  Skipped: 0  Found: 2

sudo arpsend -D -e 192.168.1.1 eno1

arpsend: can't get iface 'eno1' address : Cannot assign requested address

ifconfig

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet6 fe80::48c6:f95d:829c:925d  prefixlen 64  scopeid 0x20<link>
    ether 74:d0:2b:2c:b0:a4  txqueuelen 1000  (Ethernet)
    RX packets 1221  bytes 128481 (128.4 KB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 874  bytes 146162 (146.1 KB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    device interrupt 20  memory 0xef300000-ef320000  

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 22543  bytes 1701449 (1.7 MB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 22543  bytes 1701449 (1.7 MB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlxc4e90a0658cc: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.1.3  netmask 255.255.255.0  broadcast 192.168.1.255
    inet6 fe80::9990:2313:9f3a:28ce  prefixlen 64  scopeid 0x20<link>
    inet6 fe80::29e5:3afd:ce7b:9742  prefixlen 64  scopeid 0x20<link>
    ether c4:e9:0a:06:58:cc  txqueuelen 1000  (Ethernet)
    RX packets 41887  bytes 32973913 (32.9 MB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 32570  bytes 6583725 (6.5 MB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ip addr show

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: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 74:d0:2b:2c:b0:a4 brd ff:ff:ff:ff:ff:ff
altname enp0s25
inet6 fe80::48c6:f95d:829c:925d/64 scope link noprefixroute 
   valid_lft forever preferred_lft forever
3: wlxc4e90a0658cc: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether c4:e9:0a:06:58:cc brd ff:ff:ff:ff:ff:ff
inet 192.168.1.3/24 brd 192.168.1.255 scope global dynamic noprefixroute wlxc4e90a0658cc
   valid_lft 81932sec preferred_lft 81932sec
inet6 fe80::9990:2313:9f3a:28ce/64 scope link 
   valid_lft forever preferred_lft forever
inet6 fe80::29e5:3afd:ce7b:9742/64 scope link noprefixroute 
   valid_lft forever preferred_lft forever

ip r

default via 192.168.1.1 dev wlxc4e90a0658cc proto dhcp src 192.168.1.3 metric 303 
default via 192.168.1.1 dev wlxc4e90a0658cc proto dhcp metric 600 
192.168.1.0/24 dev wlxc4e90a0658cc proto dhcp scope link src 192.168.1.3 metric 303

route

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         H388X.home      0.0.0.0         UG    303    0        0 wlxc4e90a0658cc
default         H388X.home      0.0.0.0         UG    600    0        0 wlxc4e90a0658cc
192.168.1.0     0.0.0.0         255.255.255.0   U     303    0        0 wlxc4e90a0658cc

systemctl restart [email protected]

Failed to restart [email protected]: Unit [email protected] not found.

sudo systemctl restart [email protected]

Failed to restart [email protected]: Unit [email protected] not found.

cat /var/log/syslog | grep dhcp4

https://pastebin.com/EEp5GgPe

相关内容