Ethernet Not Working in Ubuntu 18.04 on New Desktop – Troubleshooting

driversethernetnetworkingrealtek

Assembled a developer (non gaming) desktop with following configuration:

  • Processor: Intel i5 8400
  • Memory: DDR4-2400 8GB (double-rank), 1.2V, CL17
  • Motherboard: MSI H310M PRO-VH
  • HDD: Seagate Barracuda 1TB 7200rpm SATA

Then I installed Ubuntu 18.04 from the latest downloaded ISO image, via a pendrive. After connecting the desktop via the onboard LAN interface, to my home router, the interface goes into, a log Connecting state, never manages to actually connect, and finally becomes Disconnected. This is when the Wired ethernet is configured with defaults to use DHCP. Here is what ip a shows:

xyz@shivalik:~$ ip a
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 30:9c:23:b3:cd:42 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::452c:f71e:f47d:1b54/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

If I modify the Wired Ethernet interface to use static-IP, the interface seems to come up, but not work. I am unable to reach even the home router, that is at the other end of the ethernet cable connected to the Desktop. In this case, here is what ip a shows:

xyz@shivalik:~$ ip -s a
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 30:9c:23:b3:cd:42 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.220/24 brd 192.168.2.255 scope global noprefixroute enp1s0
       valid_lft forever preferred_lft forever
    inet6 fe80::452c:f71e:f47d:1b54/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
    RX: bytes  packets  errors  dropped overrun mcast   
    0          0        0       0       0       0       
    TX: bytes  packets  errors  dropped carrier collsns 
    1624       35       0       0       0       0  

The motherboard documentation says that it has the Realtek RTL8111H Gigabit LAN controller on board. Here some of the troubleshooting information I've gathered on this host:

xyz@shivalik:~$ lspci -knn | grep Eth -A3
01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
    Subsystem: Micro-Star International Co., Ltd. [MSI] RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [1462:7b33]
    Kernel driver in use: r8169
    Kernel modules: r8169

and

xyz@shivalik:~$ sudo lshw -C network
  *-network                 
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: enp1s0
       version: 15
       serial: 30:9c:23:b3:cd:42
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       resources: irq:123 ioport:3000(size=256) memory:a1104000-a1104fff memory:a1100000-a1103fff

Have replaced the LAN cables (with brand new spare ones I had), but that didn't change anything. The LAN port LEDs indicate PHY connectivity it seems, on both end and they are blinking, albeit slowly. What do I have to do to get the network working on this desktop ?

Best Answer

The solution is available at this off-SO link.

In summary, here is what I did that solved the issue.

  1. Inserted a WiFi USB dongle and connected to the WiFi router, and tested that internet connection is working.
  2. Did: sudo apt-get update
  3. Did: sudo apt-get install r8168-dkms to install the r8168 kernel driver (suppressing the r8169 driver that came default with the kernel)
  4. Reboot the PC
  5. After reboot the Wired Ethernet started working.
Related Question