I use static IP for my wired connection controlled via Network Manager.
ip link show enp4s0
2: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq state DOWN mode DEFAULT group default qlen 1000
NO-CARRIER would seem to indicate a driver issue as I'm posting this on the same PC by selecting the 4.18.0.17 prior kernel in grub. NetworkManager.service and avahi-daemon.service are both LOADED and ACTIVE.
But NetworkManager not happy as shown...
NetworkManager[1103]: <info> [1555719488.0396] device (enp4s0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
NetworkManager[1103]: <info> [1555719488.0402] manager: NetworkManager state is now CONNECTED_LOCAL
NetworkManager[1103]: <info> [1555719488.9594] manager: NetworkManager state is now CONNECTED_SITE
NetworkManager[1103]: <info> [1555719488.9595] policy: set 'LaN' (enp4s0) as default for IPv4 routing and DNS
NetworkManager[1103]: <info> [1555719488.9603] device (enp4s0): Activation: successful, device activated.
NetworkManager[1103]: <info> [1555719488.9609] manager: NetworkManager state is now CONNECTED_GLOBAL
NetworkManager[1103]: <info> [1555719488.9616] manager: startup complete
NetworkManager[1103]: <info> [1555719495.0373] device (enp4s0): state change: activated -> unavailable (reason 'carrier-changed', sys-iface-state: 'managed')
NetworkManager[1103]: <info> [1555719495.0583] manager: NetworkManager state is now DISCONNECTED
NetworkManager[1103]: <info> [1555719505.6899] agent-manager: req[0x55c9724642a0, :1.63/org.freedesktop.nm-applet/1000]: agent registered
Could it be the wrong phy driver selected or Network Manager bug?
"ip link set enp4s0 up" doesn't help.
I had a similar issue (no wired ethernet after upgrade to 19.10). I lived with that for a while and just used
ifup
in.bashrc
. But when I took a deeper look into this problem, I got directed by Google to this page.However, none of solutions above solved my problem. Apparently, I found the solution when tried to change from
ifup
tonetplan
. At that moment, I realized that there is a parameter in NetworkManager config (/etc/NetworkManager/NetworkManager.conf
) that allows the NetworkManager to control interfaces. I hadmanaged=false
there.Simply changing it to:
creating an empty file:
and restarting NetworkManager:
solved my issues.
I am just posting my observations here as an answer. I hope I will eventually come to a solution, so I will be able to update this answer appropriately.
I am having the exact problem:
During power on this problem does not occur. But, it occurs always after an OS restart (soft reboot).
So far, the only solution is this: Unplug the ethernet cable; boot your machine; plug back the cable after boot is complete. Ethernet connection will never work if the network cable is plugged during boot!
I followed the suggestions in https://ubuntu-mate.community/t/19-04-ethernet-wired-connection-refuses-to-connect-when-plugged-in-before-boot/19333/8 and as the original poster there, I had no improvement. Here are my observations and I am requesting you (once_a_NoOb_always_a) to verify them:
This problem started after the upgrade from Ubuntu 18.10 to 19.04. Initially (during the first reboot after the upgrade) the problem did not occur. But, later (after the second reboot) it started to occur persistently.
If you start the machine with the ethernet cable disconnected and connect it after it boots, the problem does not occur.
In any case, the link level connection is successful (even after you disconnect and reconnect the cable or after your do
ip link set enp3s0f1 down
andip link set enp3s0f1 up
). I can see from my router that the relevant ethernet port is up and packets travel in both directions. However, there is something very strange happening: I am using static IP addresses for my Wired and Wireless connection in my Ubuntu box; these end with 14 and 15 respectively. When I enable the ethernet (wired) interface my router sees the same IP address ending with 14 in both of the Ubuntu box interfaces.My provisional deduction is that the network stack somehow mixes the MAC addresses of the two interfaces. (Please note, that normally my Wireless interface is hardware-disabled when I boot and use my computer; normally I only used the Wired connection. However, even in such a scenario my upgraded Ubuntu box does not connect to the ethernet network. To only solution seems to physically disconnect the ethernet cable while booting and connecting it after the boot.)It seems to me that the new kernel 5.0.0-13 has some buggy software for this card (RTL8411B) :(
@drblah : your suggestion did not work for me. The netplan commands you mentioned have no effect and the /etc/netplan/01-network-manager-all.yaml file is not updated (file date stays in 18-Oct-2018 with the same contents).
I ran into the same issue as you. The workaround I found was to make netplan re-generate the network configuration:
After running the two commands you should be able to configure the network with your usual configuration tools.
By default, netplan will have a configuration file called: /etc/netplan/01-network-manager-all.yaml with the following contents:
This will simply tell the system to let all interfaces be controlled by network manager. I don't know exactly why this worked for me, because netplan was already supposed to be managing the network interface.
For reference the output of lspci for my ethernet controller is:
Solved it for me by installing dkms for driver for r8168. True, under kernel 4.18 the NIC operated under r8169 just fine, but not under the "improved" version of kernel 5.0 used with kubuntu 19.04.
Same bug here it seems. The problem is I think caused by NetworkManager that performs an incorrect dhclient procedure, and triggering IP conflicts in the switch of my network, causing the connection be dead for about 30 minutes. See also this bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1793763
UPDATE: To work arround this problem, you can use ifplugd together with ifupdown to handle ethernet connections, while still using NetworkManager for the wireless connections. To do this:
Install ifupdown and resolvconf:
disable systemd-resolved
edit /etc/NetworkManager/NetworkManager.conf to leave ifupdown devices alone, and use resolvconf to update /etc/resolv.conf, and use plain DNS servers from the dhcp server instead of systemd-resolved 127.0.0.53 service.
Next add following lines to /etc/network/interfaces to define the ethernet device (in my case enp0s25)
Make sure there are no
auto enp0s25
lines in the file, because ifup should not be executed automatically on boot, but by ifplugd when plugging in an ethernet connection.So next install ifplugd and configure it so the enp0s25 device is being listend on for correct connecting/deconnecting triggers
Also, make the file
/etc/dhcp/dhclient-enter-hooks.d/resolved
empty, because else resolvconf will never work from ifupdown:also don't remove this file or it will be re-installed by next system update.
Finally, start and enable ifplugd, restart NetworkManager for updated configuration.
and/or reboot to check if everything's set up correctly.
Disclaimer 1: I haven't replayed this script on a fresh ubuntu install to verify if it is completely correct (however I've checked bash_history ;). Please reply if something doesn't work.
Disclaimer 2 this works for Ubuntu LTS 18.04
Disclaimer 3: Maybe this can also work with systemd-resolved or even DNSMasq or unbound but I don't know how exactly and I personally don't want it.
I had the same problem occurring on Debian Buster with a wildly different hardware.
As Tomcat pointed out, NetworkManager tried to negotiate a 100mpbs connection but "timed out" and took the connection into power saving.
Try using
ethtool --set-eee enpXsX eee off
to turn off Energy Efficient Ethernet (EEE).I have r8169 Ubuntu 19.10 and do not see r8169-dkms on repo
So I have solved by workaround:
$ sudo systemctl edit --full rc-local
this enable rc.local Compatibility:
$ sudo systemctl status rc-local
Then I create a
/etc/rc.local
(as root using sudo)This script run after network.target but is too early so I add the sleep 55: my system start up in 2 min and this script is not blocking ...
The restart make driver work.
do this:
$ sudo chmod 775 /etc/rc.local
Waiting r8169 work on ubuntu 19.10.
I hope that this help.
regards,
Leonardo