Score:1

Ethernet connection not working - Network activation failed

ki flag

So I am aware there are similar problems out there however I could not solve mine with any of the solutions so far:

I am trying to connect to a LAN network from my Thinkpad P14s (Intel) running with Ubuntu 20.04 Desktop. I keep getting: "Activation of Network connection failed" and I am running out of possible solutions. I do not have access to a router and the exact same cable connection works e.g., for a windows laptop so it cannot be the cable or the connection I think.

I tried:

  1. full reinstallation of Ubuntu
  2. the steps along this post
  3. reinstalling network manager
  4. restarting network manager
  5. different LAN cables
  6. installing HWE: sudo apt install linux-generic-hwe-20.04

According to the logoutput (sudo journalctl -b 0 -u NetworkManager) the dhcp request runs into a time out: output

Here is the output of lshw -C network

*-network:0               
       description: Wireless interface
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 14.3
       bus info: pci@0000:00:14.3
       logical name: wlp0s20f3
       version: 20
       serial: a0:e7:0b:d2:f7:21
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=5.11.0-40-generic firmware=59.601f3a66.0 QuZ-a0-hr-b0-59.u ip=10.181.78.114 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: iomemory:600-5ff irq:16 memory:6053bc4000-6053bc7fff
  *-network:1
       description: Ethernet interface
       product: Ethernet Connection (13) I219-V
       vendor: Intel Corporation
       physical id: 1f.6
       bus info: pci@0000:00:1f.6
       logical name: enp0s31f6
       version: 20
       serial: 90:2e:16:93:b9:4d
       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.11.0-40-generic duplex=full firmware=0.8-3 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:149 memory:bec80000-bec9ffff
  *-network
       description: Ethernet interface
       physical id: 2
       bus info: usb@2:3.3
       logical name: enx34298f70f2f4
       serial: 34:29:8f:70:f2:f4
       size: 10Mbit/s
       capacity: 1Gbit/s
       capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.11.11 duplex=half firmware=rtl8153a-4 v2 02/07/20 link=no multicast=yes port=MII speed=10Mbit/s

output of nmcli connection:

NAME                     UUID                                  TYPE      DEVICE    
netplan-enp0s31f6        d4735e4b-9bfa-3052-b1c4-ef3302803c9a  ethernet  enp0s31f6 

Setting a different dhcp client (as suggested in this post ) I can at least get the logs to change:

nov 25 14:40:09 l dhclient[10449]: DHCPDISCOVER on enp0s31f6 to 255.255.255.255 port 67 interval 10 (xid=0x4c152271)
nov 25 14:40:10 l NetworkManager[9427]: <info>  [1637847610.7508] device (enp0s31f6): state change: ip-config -> deactivating (reason 'user-requested', sys-iface-state: 'managed')
nov 25 14:40:10 l NetworkManager[9427]: <info>  [1637847610.7514] manager: NetworkManager state is now DISCONNECTING
nov 25 14:40:10 l NetworkManager[9427]: <info>  [1637847610.7527] audit: op="device-disconnect" interface="enp0s31f6" ifindex=2 pid=9100 uid=1000 result="success"
nov 25 14:40:10 l NetworkManager[9427]: <info>  [1637847610.7622] device (enp0s31f6): state change: deactivating -> disconnected (reason 'user-requested', sys-iface-state: 'managed')
nov 25 14:40:10 l NetworkManager[9427]: <info>  [1637847610.7658] dhcp4 (enp0s31f6): canceled DHCP transaction, DHCP client pid 10449
nov 25 14:40:10 l NetworkManager[9427]: <info>  [1637847610.7658] dhcp4 (enp0s31f6): state changed unknown -> done
nov 25 14:40:11 l NetworkManager[9427]: <info>  [1637847611.0623] manager: NetworkManager state is now DISCONNECTED
nov 25 14:40:11 l NetworkManager[9427]: <info>  [1637847611.5681] device (enp0s31f6): Activation: starting connection 'netplan-enp0s31f6' (d4735e4b-9bfa-3052-b1c4-ef3302803c9a)
nov 25 14:40:11 l NetworkManager[9427]: <info>  [1637847611.5682] audit: op="connection-activate" uuid="d4735e4b-9bfa-3052-b1c4-ef3302803c9a" name="netplan-enp0s31f6" pid=9100 uid=1000 result="success"
nov 25 14:40:11 l NetworkManager[9427]: <info>  [1637847611.5685] device (enp0s31f6): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
nov 25 14:40:11 l NetworkManager[9427]: <info>  [1637847611.5694] manager: NetworkManager state is now CONNECTING
nov 25 14:40:11 l NetworkManager[9427]: <info>  [1637847611.5699] device (enp0s31f6): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
nov 25 14:40:11 l NetworkManager[9427]: <info>  [1637847611.5712] device (enp0s31f6): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
nov 25 14:40:11 l NetworkManager[9427]: <info>  [1637847611.5719] dhcp4 (enp0s31f6): activation: beginning transaction (timeout in 45 seconds)
nov 25 14:40:11 l NetworkManager[9427]: <info>  [1637847611.5755] dhcp4 (enp0s31f6): dhclient started with pid 10539
nov 25 14:40:11 l dhclient[10539]: DHCPDISCOVER on enp0s31f6 to 255.255.255.255 port 67 interval 3 (xid=0x7d307302)
nov 25 14:40:11 l dhclient[10539]: Can't create /run/NetworkManager/dhclient-enp0s31f6.pid: Permission denied
nov 25 14:40:14 l dhclient[10539]: DHCPDISCOVER on enp0s31f6 to 255.255.255.255 port 67 interval 8 (xid=0x7d307302)

Thanks a lot in advance.

Edit 1 As asked by @heynnema, ouput of cat /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

Output of cat /etc/netplan/*.yaml:

network:
  ethernets:
    enp0s31f6:
      dhcp4: true
  version: 2
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
network:
  version: 2
  renderer: NetworkManager

Edit 2 After following the steps of @heynnema below I still get the same error, here's the output of journalctl -b 0 -u NetworkManager:

nov 29 08:53:12 l NetworkManager[1034]: <info>  [1638172392.1044] device (enp0s31f6): Activation: starting connection 'Wired connection 1' (5f5a5254-5476-3279-9b2a-cfc3981d7e66)
nov 29 08:53:12 l NetworkManager[1034]: <info>  [1638172392.1046] audit: op="connection-activate" uuid="5f5a5254-5476-3279-9b2a-cfc3981d7e66" name="Wired connection 1" pid=3796 uid=1000 result="succe>
nov 29 08:53:12 l NetworkManager[1034]: <info>  [1638172392.1047] device (enp0s31f6): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
nov 29 08:53:12 l NetworkManager[1034]: <info>  [1638172392.1054] manager: NetworkManager state is now CONNECTING
nov 29 08:53:12 l NetworkManager[1034]: <info>  [1638172392.1058] device (enp0s31f6): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
nov 29 08:53:12 l NetworkManager[1034]: <info>  [1638172392.1069] device (enp0s31f6): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
nov 29 08:53:12 l NetworkManager[1034]: <info>  [1638172392.1075] dhcp4 (enp0s31f6): activation: beginning transaction (timeout in 45 seconds)
nov 29 08:53:12 l NetworkManager[1034]: <info>  [1638172392.1114] dhcp4 (enp0s31f6): dhclient started with pid 3874
nov 29 08:53:12 l dhclient[3874]: DHCPDISCOVER on enp0s31f6 to 255.255.255.255 port 67 interval 3 (xid=0xbf0c12b)
nov 29 08:53:12 l dhclient[3874]: Can't create /run/NetworkManager/dhclient-enp0s31f6.pid: Permission denied
nov 29 08:53:15 l dhclient[3874]: DHCPDISCOVER on enp0s31f6 to 255.255.255.255 port 67 interval 8 (xid=0xbf0c12b)
nov 29 08:53:23 l dhclient[3874]: DHCPDISCOVER on enp0s31f6 to 255.255.255.255 port 67 interval 11 (xid=0xbf0c12b)
nov 29 08:53:34 l dhclient[3874]: DHCPDISCOVER on enp0s31f6 to 255.255.255.255 port 67 interval 21 (xid=0xbf0c12b)
nov 29 08:53:55 l dhclient[3874]: DHCPDISCOVER on enp0s31f6 to 255.255.255.255 port 67 interval 12 (xid=0xbf0c12b)
nov 29 08:53:57 l NetworkManager[1034]: <warn>  [1638172437.5143] dhcp4 (enp0s31f6): request timed out
nov 29 08:53:57 l NetworkManager[1034]: <info>  [1638172437.5144] dhcp4 (enp0s31f6): state changed unknown -> timeout
nov 29 08:53:57 l NetworkManager[1034]: <info>  [1638172437.5144] device (enp0s31f6): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
nov 29 08:53:57 l NetworkManager[1034]: <info>  [1638172437.5154] manager: NetworkManager state is now DISCONNECTED
nov 29 08:53:57 l NetworkManager[1034]: <warn>  [1638172437.5171] device (enp0s31f6): Activation: failed for connection 'Wired connection 1'
nov 29 08:53:57 l NetworkManager[1034]: <info>  [1638172437.5177] device (enp0s31f6): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
nov 29 08:53:57 l NetworkManager[1034]: <info>  [1638172437.5584] dhcp4 (enp0s31f6): canceled DHCP transaction, DHCP client pid 3874
nov 29 08:53:57 l NetworkManager[1034]: <info>  [1638172437.5585] dhcp4 (enp0s31f6): state changed timeout -> done

According to this forum post (which is for Ubuntu Sever however) there might be a problem with the .leases files, however in my /etc/passwd file there is no user dhcp. Here's the contents of my /var/lib/dhcp directory:

drwxr-xr-x  2 root root 4096 nov  9 13:11 .
drwxr-xr-x 70 root root 4096 nov 22 15:02 ..
-rw-r--r--  1 root root    0 nov 25 14:23 dhclient.leases

Edit 3

As asked by @heynnema: Output of ls -la /etc/network/interfaces.d

total 8
drwxr-xr-x 2 root root 4096 mag  3  2019 .
drwxr-xr-x 7 root root 4096 nov 25 14:26 .

Output of ls -la /run/NetworkManager/:

total 8
drwxr-xr-x  5 root root  160 nov 29 12:16 .
drwxr-xr-x 38 root root 1060 nov 29 12:15 ..
drwxr-xr-x  2 root root   60 nov 29 12:14 conf.d
drwxr-xr-x  2 root root   80 nov 29 12:23 devices
-rw-r--r--  1 root root  274 nov 29 12:16 no-stub-resolv.conf
srwxr-xr-x  1 root root    0 nov 29 12:14 private-dhcp
-rw-r--r--  1 root root   74 nov 29 12:16 resolv.conf

Output of grep -i -v "#" /etc/dhcp/dhclient.conf:

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers;

timeout 300;
heynnema avatar
ru flag
Edit your question and show me `cat /etc/network/interfaces` and `cat /etc/netplan/*.yaml`. Start comments to me with @heynnema or I'll miss them.
ki flag
@heynnema , done!
Score:0
ru flag

Assuming that you're running Ubuntu 20.04 Desktop...

It looks like you have multiple .yaml files in /etc/netplan.

Delete this .yaml file..

network:
  ethernets:
    enp0s31f6:
      dhcp4: true
  version: 2

Keep this .yaml file...

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

Delete this .yaml file...

network:
  version: 2
  renderer: NetworkManager

sudo netplan generate

sudo netplan apply

reboot

Then, if needed, configure your network connection using the standard NetworkManager GUI.

ki flag
I tried it with a live version which lead to the same problem (and also had the laptop sent back for repairs where it was reported that the LAN connection works)
ki flag
also I've tried installing oem 5.14.0-1027 which did not result in anything either
heynnema avatar
ru flag
@rubinreisen Sorry it's taken so long to get this working for you. Edit your question and show me `ls -al /etc/network/interfaces.d` and `ls -al /etc/netplan` and `cat /etc/netplan/*.yaml`. And a screenshot of Settings/Network.
ki flag
thanks for sticking around and all your help! I have edited the post.
heynnema avatar
ru flag
@rubinreisen You're welcome. Please describe the EXACT ethernet cabling from the computer, all the way to the router/modem. Are you using cat 5e or cat 6 cables?
ki flag
I don't have access to the router its a company network, however, a colleague tried the very same outlet with the same cable with his windows machine and it worked. For me I tried both plugging the cable directly into the LAN port of my Laptop and via a USB-C docking station. The cables are cat 5e I believe at least it looks like the one on the right [here](https://cdn.chipkin.com/assets/uploads/2021/Aug/cat5andCat6PatchCable_04-19-55-03.png)
heynnema avatar
ru flag
@rubinreisen Unfortunately you can't compare this to a working Windows machine... they just do things different. Show me `cat /etc/NetworkManager/NetworkManager.conf`. Is there a different place to try and connect the ethernet to see if it works there?
ki flag
thanks for you reply. Unfortunately it did not help, I still get the same error and no connection. I made a second edit (Edit 2) which contains the logoutput.
heynnema avatar
ru flag
Edit your question and show me `ls -al /etc/network/interfaces.d` and `ls -al /run/NetworkManager/` and `grep -i -v "#" /etc/dhcp/dhclient.conf`.
ki flag
thanks i updated the post
heynnema avatar
ru flag
@rubinreisen The only thing curious is the flag "/run/NetworkManager/private-dhcp". If you run `sudo dhclient` what happens?
ki flag
It outputs: `RTNETLINK answers: File exists` with the same "Permission Denied" error appearing in the logs when trying to connect.
heynnema avatar
ru flag
@rubinreisen Temporarily rename `/run/NetworkManager/private-dhcp` to `/run/NetworkManager/private-dhcp.HOLD` and retry. Rename this back later.
heynnema avatar
ru flag
@rubinreisen Also try booting to a Ubuntu Live 21.10 DVD/USB and see if things work.
ki flag
when I rename to `/run/NetworkManager/private-dhcp.HOLD` and run `sudo dhclient` I get `RTNETLINK answers: Operation not possible due to RF-kill`
heynnema avatar
ru flag
@rubinreisen Does `rfkill` show any blocked interfaces?
heynnema avatar
ru flag
@rubinreisen Show me a screenshot of the IPv4 tab in your Wired connection profile. Enlarge the window to capture all of it.
ki flag
[1](https://pasteboard.co/6BCHvVeL86Wz.png), [2](https://pasteboard.co/AbifjWbeabSb.png). could not enlarge, sorry after: 1. renaming to `private-dhcp.HOLD`, 2. running `sudo dhclient`, `rfkill` shows the following line with "blocked": `1 wlan phy0 blocked unblocked`
heynnema avatar
ru flag
@rubinreisen Rename `private-dhcp.HOLD` back to normal. Try the Ubuntu Live suggestion.
ki flag
ok so we had the whole network reset and now the LAN connection finally works aparently it was not a problem on my end in the end. Thank you so much for your help I still hope that the steps elaborated above will help others with similar problems anyways.
heynnema avatar
ru flag
@rubinreisen Glad it's working for you now. You did have a problem on your end though. You had multiple /etc/netplan/*.yaml files that contradicted each other, and my answer resolved that. Please consider accepting my answer by clicking on the checkmark icon that appears just to the left of my answer. Thanks!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.