0

I have a network card in an Ubuntu machine that will not come up (as in link down, layer 1 problem). The driver is loaded, as shown below:

$ ethtool -i ens8
driver: r8169
version: 6.8.0-35-generic
firmware-version: rtl8168h-2_0.0.2 02/26/15
expansion-rom-version: 
bus-info: 0000:00:08.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes
supports-priv-flags: no

I try to bring the link up and this is is what happens, it just stays down.

$ sudo ip link set ens8 up
$ ip a | grep -A3 ens8
3: ens8: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 9c:53:22:48:71:63 brd ff:ff:ff:ff:ff:ff
    altname enp0s8

I check dmesg for and kernel/driver alerts:

$ sudo dmesg -T | grep "ens8\|r8169"
[Wed Jun 12 21:13:19 2024] r8169 0000:00:08.0 eth0: RTL8168h/8111h, 9c:53:22:48:71:63, XID 541, IRQ 29
[Wed Jun 12 21:13:19 2024] r8169 0000:00:08.0 eth0: jumbo features [frames: 9194 bytes, tx checksumming: ko]
[Wed Jun 12 21:13:19 2024] r8169 0000:00:08.0 ens8: renamed from eth0
[Wed Jun 12 21:13:22 2024] Generic FE-GE Realtek PHY r8169-0-40:00: attached PHY driver (mii_bus:phy_addr=r8169-0-40:00, irq=MAC)
[Wed Jun 12 21:13:22 2024] r8169 0000:00:08.0 ens8: No native access to PCI extended config space, falling back to CSI
[Wed Jun 12 21:13:22 2024] r8169 0000:00:08.0 ens8: Link is Down

I see that it says "No native access to PCI extended config space", which google doesn't have a clear answer on. I'm not sure where to go with this and I'm looking for help to resolve this problem.

I have created a basic network profile in network manager to bring specifically ens8 up with a dynamic IP, but when I try activate it, I get the following:

$ nmcli con up PCINIC
Error: Connection activation failed: No suitable device found for this connection (device ens3 not available because profile is not compatible with device (mismatching interface name)).

I have also included this profile (a brief version for simplicity) below as to display the settings I used:

$ nmcli con show PCINIC 
connection.id:                          PCINIC
connection.type:                        802-3-ethernet
connection.interface-name:              ens8
connection.autoconnect:                 yes
connection.autoconnect-priority:        400
ipv4.method:                            auto

Side notes: This is a VM using PCI passthrough for the PCI network card in the host machine. This NIC works if I move it into an Ubuntu 18.04 VM no problem. However after I installed a new VM using Ubuntu 24.04 LTS and removed that NIC from the old VM to the new one, I cannot seem to get this link up. So it's not a fault with the NIC, it's driver related in my opinion.

EDIT: Added some lspci output, as well and manually setting speed duplex:

$ lspci -knn | grep -A 5 00:08
00:08.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8161] (rev 15)
    Subsystem: Realtek Semiconductor Co., Ltd. TP-Link TG-3468 v4.0 Gigabit PCI Express Network Adapter [10ec:8168]
    Kernel driver in use: r8169
    Kernel modules: r8169, r8168

I have also tried manually setting speed and duplex via the following:

$ nmcli con modify PCINIC 802-3-ethernet.auto-negotiate no 802-3-ethernet.speed 1000 802-3-ethernet.duplex full 
$ sudo systemctl restart NetworkManager.service
$ nmcli con up PCINIC
Error: Connection activation failed: No suitable device found for this connection (device ens3 not available because profile is not compatible with device (mismatching interface name)).
$ ip a | grep ens8
3: ens8: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000

Now set it back to auto:

$ nmcli con modify PCINIC 802-3-ethernet.auto-negotiate yes
$ sudo systemctl restart NetworkManager.service 
$ nmcli con up PCINIC
Error: Connection activation failed: No suitable device found for this connection (device ens3 not available because profile is not compatible with device (mismatching interface name)).
$ ip a | grep ens8
3: ens8: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000

To be clear this card works fine in an Ubuntu 18.04 vm I have still on this computer, ruling out the cable and switch connected to the other end.

5
  • Two things to look at right away. in the response to the ip a command - it states NO-CARRIER This means there is no layer2 link for your network. Is the physical cable connected to a switch on the other end? or another device? If it is a switch, does the port have any indicator lights, and if so are they on? The second thing to look at is Jumbo Frames. If the interface is connected to a switch, then you need to ensure the switch can handle jumbo frames, or disable jumbo frames on the nic. Jumbo frames are normally only enabled for iscsi, fcoe or other network storage protocols. ip link set ens Commented Jun 16 at 1:09
  • Hi, I think you missed the bit where I said "This NIC works if I move it into an Ubuntu 18.04 VM no problem". The switch is not the issue, nor is the cable. The MTU also said it was set to 1500 in the 2nd code snippet above.
    – john smith
    Commented Jun 17 at 17:59
  • 1
    @johnsmith Are you talking about virtual NICs or physical NICs being passed into VMs? The second is much more complicated and not recommended to directly pass into a VM but to use a dedicated vswitch/bridge on the host for that connection.
    – Thomas Ward
    Commented Jun 17 at 18:43
  • Oh my god I'm such an idiot. I figured it out. I have two NIC's passed through and I passed the wrong NIC through to the second VM. I'm not even sure how I did that since I tested the link light came up and down before i moved the NIC on the VM. So sorry. But I re-checked everything from scratch after your post, and then I discovered the problem. I've now got it working. Appreciate your posting to support me either way, thank you. It seems that the PCI slot number on virtual-machine manager changes as I pass it through to another VM. Didn't even think that would be a thing!
    – john smith
    Commented Jun 17 at 18:50
  • And thanks for the post about the vswitch/bridge. I'm a network engineer for a living, and I wanted to just get a clean (unshared) NIC for performance testing, so I set it up a bit differently. Although you have sub-directed my mini project to comparing throughput via a vswitch.
    – john smith
    Commented Jun 17 at 18:55

1 Answer 1

0

I figured out the answer to my own post, but giving others the answer in case you run into this same trouble:

I'll do my best to explain this as its confusing. I have Qemu/Virtual Machine Manager on my host PC. I created an Ubuntu VM and assigned two PCI slots (which are physical network cards) to it within Virtual Machine Manager; specifically PCI 0000:09:00.0 and PCI 0000:07:00.0. On the VM host these adapters come up with this mapping:

PCI 0000:09:00.0, Plugging cable in brings up enp6s0, and the NIC located physically at the bottom of my PC lights up
PCI 0000:07:00.0, Plugging cable in brings up enp7s0, and the NIC located physically at the top of my PC lights up

I now remove PCI 0000:07:00.0 from this Ubuntu VM on the host within Virtual Machine Manager and attach this to a different VM, lets refer to this as VM2. When this device starts up this is what happens regarding the mapping:

PCI 0000:07:00.0, plugging cable into the top NIC does NOT bring up the port.  HOWEVER, if I plug this into the bottom NIC on my PC, the link light comes up, and my network interface comes up on the VM!

Interestingly, when the original VM starts, it now uses the top NIC in my PC. So it's like the physical mapping changes it. I don't understand exactly why it does that, but I now can get my NIC working since I discovered re-maps the PCI slot to another card once the NIC is removed from the VM. So this is why the port did not come up when a cable was plugged in.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .