Score:0

How to enable secondary ethernet NIC card?

cn flag

I recently set up a new Ubuntu 20.04 install on an old PC of mine. It's running some docker containers just fine. However, its installed ethernet NIC doesn't support 1000 Mbps speed. I'd like to be able to take advantage of my home network speed, so I bought this ethernet NIC. I'm new to hardware modification, but I believe I installed it correctly. I just plugged it into a PCIe port. I can see that my PC recognizes it, but does not use it.

lspci shows 05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. Device 8161 (rev 15)

ip addr shows new ethernet connection:

2: enp5s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 40:3f:8c:76:a2:c0 brd ff:ff:ff:ff:ff:ff

I restarted my PC a couple times, and realized that the NIC would not appear on ipconfig, only on ipconfig -a. After doing sudo ipconfig enp5s0 up, it would appear on ipconfig. What does this mean? How can I make it appear on boot so that I can use it as my primary connection?

The company does not offer an official Linux driver, but the Realtek r8168 driver supposedly works. I installed it by updating the package lists to "universe" and did sudo apt update && sudo apt install r8168-dkms. lsmod shows me that both r8169 (buggy driver) and r8168 (driver I want) are installed but not used by enp5s0:

r8168                 548864  0
r8169                  90112  0

I also blacklisted r8169 by adding it to /etc/modprobe.d/blacklist.conf. Still, ethtool -i enp5s0 shows me that it's still "driver: r8169".

I've tried using nmtui, but it won't let me apply the connection to the device because 'the device is strictly unmanaged'. I googled this, but all that came up was changing a line in /etc/NetworkManager/NetworkManager.conf from managed=false to managed=true. Restarted network manager service but still nmcli d shows all devices as unmanaged. Not sure if related.

All in all, plugging in an ethernet cable to the new port is not working. I use SSH to manage this pc because it's headless, so I can't connect when I use that port. Perhaps I'll get a monitor and keyboard and see what the previous commands say when I plug in just to the new port. If anyone had a similar problem, please let me know. I appreciate any help

Edit: Output of sudo dmesg -l emerg,alert,crit,err,warn: https://paste.ubuntu.com/p/7zp2MFg84g/

Edit: output of @chili555's commands: https://paste.ubuntu.com/p/25Rfdknr7p/

paladin avatar
kr flag
Please do a `sudo dmesg -l emerg,alert,crit,err,warn` and post the results.
chili555 avatar
cn flag
Please run the following terminal commands: `tail -n5 /etc/modprobe.d/blacklist.conf` and: `lsmod | grep r816` and: `cat /etc/netplan/*.yaml` Paste the results here and give us the link: http://paste.ubuntu.com
ZackT avatar
cn flag
Thanks for the replies. I've posted the results on the body. @chili555 For the netplan yaml file, I had tried to configure a static IP for my other Ethernet adapter.
chili555 avatar
cn flag
Did the static IP not work as expected? Does: `ip addr show` have an IP address for enp0s10? To be clear, id the old NIC card unplugged?
ZackT avatar
cn flag
@chili555 the static IP is for my other ethernet NIC and it's working as far as I can see (Still the same IP). `ip addr show` does not show any IP address for my new NIC. I didn't unplug the old one, should I do so? I'd prefer to touch my PC as little as possible but if that's the problem then I will. If it is the problem, It seems kind of obvious now. dumb mistake on my part
chili555 avatar
cn flag
Does the IP address on the old NIC differ from that shown in netplan? I thought that the intent was to use the new NIC because of its 1 gHz speed. You can't know if it's working correctly if it isn't even plugged in. Or are both plugged in?
chili555 avatar
cn flag
Please join me in chat: https://chat.stackexchange.com/rooms/127043/chat-with-zackt-and-chili555
ZackT avatar
cn flag
Yes, sorry for causing confusion, the intent is to use the new NIC due to its speed. I just mentioned that before I was also configuring a static IP for my old NIC before I installed the new one. Both NICs are plugged in. I'm using SSH to communicate with my server, so I can tell that when I only connect an Ethernet cord to the new NIC, I cannot connect. Only when I connect a cord to the old one, I can ssh into it.
Score:1
cn flag

My suggestions are to make sure that the new NIC will connect and get an IP address:

sudo dhclient -v enp5s0

Did it get an IP address? Confirm:

ip addr show

If it did, then amend the netplan file to use only enp5s0. Carefully follow the examples: cat /usr/share/doc/netplan/examples/static.yaml

Netplan is strict about indentation, spacing, etc, so be cautious. Once the file is set, follow with:

sudo netplan generate

And then:

sudo netplan apply

It ought to take immediate effect. Did the interface get the requested address? Check:

ip addr show

If so, you are all set and you can detach the ethernet cable from the old NIC.

ZackT avatar
cn flag
Yep, this worked! Thank you again
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.