为什么我的有线连接在 Ubuntu 18.04 上会因二次连接失败而失败?

为什么我的有线连接在 Ubuntu 18.04 上会因二次连接失败而失败?

当我更改 ufw 规则时,有线连接突然完全失败。即使禁用 ufw,每次我尝试连接有线连接时,它都会失败。

我可以启动到旧的 16.10 live usb,并且有线连接工作正常。

当我尝试连接后立即检查 journalctl 时,我得到以下信息:

Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1360] device (enp0s31f6): Activation: starting connection 'Wired connection 1' (01920e80-0c39-3968-ab5e-99dbba5f8e64) Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1363] audit: op="connection-activate" uuid="01920e80-0c39-3968-ab5e-99dbba5f8e64" name="Wired connection 1" pid=2481 uid=1000 result="su Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1368] device (enp0s31f6): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed') Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1373] manager: NetworkManager state is now CONNECTING Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1381] device (enp0s31f6): state change: prepare -> config (reason 'none', sys-iface-state: 'managed') Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1399] device (enp0s31f6): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed') Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1401] dhcp4 (enp0s31f6): activation: beginning transaction (timeout in 45 seconds) Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1425] dhcp4 (enp0s31f6): dhclient started with pid 3406 Jul 06 09:22:54 mark-dev dhclient[3406]: DHCPREQUEST of 192.168.0.2 on enp0s31f6 to 255.255.255.255 port 67 (xid=0x70f92a1a) Jul 06 09:22:54 mark-dev dhclient[3406]: DHCPACK of 192.168.0.2 from 192.168.0.1 Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1707] dhcp4 (enp0s31f6): address 192.168.0.2 Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1707] dhcp4 (enp0s31f6): plen 24 (255.255.255.0) Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1708] dhcp4 (enp0s31f6): gateway 192.168.0.1 Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1708] dhcp4 (enp0s31f6): lease time 3600 Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1708] dhcp4 (enp0s31f6): hostname 'mark-dev' Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1708] dhcp4 (enp0s31f6): nameserver '192.168.0.1' Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1708] dhcp4 (enp0s31f6): domain name 'gateway' Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1708] dhcp4 (enp0s31f6): state changed unknown -> bound Jul 06 09:22:54 mark-dev avahi-daemon[1207]: Joining mDNS multicast group on interface enp0s31f6.IPv4 with address 192.168.0.2. Jul 06 09:22:54 mark-dev avahi-daemon[1207]: New relevant interface enp0s31f6.IPv4 for mDNS. Jul 06 09:22:54 mark-dev avahi-daemon[1207]: Registering new address record for 192.168.0.2 on enp0s31f6.IPv4. Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1720] device (enp0s31f6): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed') Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1726] device (enp0s31f6): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed') Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1727] policy: set 'Wired connection 1' (enp0s31f6) as default for IPv4 routing and DNS Jul 06 09:22:54 mark-dev NetworkManager[1266]: <warn> [1562368974.1742] policy: secondary connection 'eb2c7cac-ca3f-40c5-84b0-4ae23db66bdf' auto-activation failed: The connection doesn't exist. Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1745] device (enp0s31f6): state change: secondaries -> failed (reason 'secondary-connection-failed', sys-iface-state: 'managed') Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1746] manager: NetworkManager state is now CONNECTED_LOCAL Jul 06 09:22:54 mark-dev NetworkManager[1266]: <warn> [1562368974.1748] device (enp0s31f6): Activation: failed for connection 'Wired connection 1' Jul 06 09:22:54 mark-dev NetworkManager[1266]: <info> [1562368974.1751] device (enp0s31f6): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')

关键似乎是二次连接失败消息,但我不知道这意味着什么,或者我用 ufw 所做的任何更改会如何影响它。

我不知道是什么原因导致了这个问题或者该如何解决它。

答案1

经过进一步的研究,我发现second-connection-failed指的是我设置的网络管理器在成功连接有线网络后自动连接的vpn。

我不确定失败的具体原因,因为指定的 vpn 已正确设置。但是,我通过运行nm-connection-editor、输入有线连接的设置并在 选项卡Automatically connect to VPN when using this connection下取消选中 解决了该问题General

这使得我的有线连接成功连接。然后我重新检查Automatically connect to VPN when using this connection并从下拉菜单中选择了一个 vpn。现在一切似乎都正常了。

相关内容