In many cases, Linux installs without the need for additional drivers or tweaking. For instance, CentOS 7.4 installed just fine. But sometimes it does not. In this case, installing Ubuntu 16.04 on a system with an Ethernet interface based on the Realtek RTL 8118AS chip ended up without a working LAN:
After conventional install (but failing to get IP address via DHCP) command ip addr shows that the LAN port is DOWN; dmesg | grep nommu will show errors like: nommu_map_single: overflow xxxxxxx+yyyyyy of device mask ffffffff, and dmesg | grep Failed will show the installed driver (r8169) reporting Failed to map RX DMA!
The following solution was tested with Ubuntu 16.04 LTS Server on a Biostar Racing B350GT5 motherboard with AMD Ryzen 1700X processor.
The solution was simple: Just modify linux boot parameter iommu=soft. You can first try this out, and if it resolves the issue make it permanent. The following start from installation from minimal Ubuntu install media. If you already did this, skip this.
[ ] Connect the LAN interface, display and keyboard [ ] Start installing Ubuntu Server 16.04 [ ] Progress until getting IP via DHCP fails: "Network autoconfiguration failed." [ ] Select "Continue" [ ] Select "Configure manually" [ ] Enter a fixed ip address, netmask, etc. (an error is ok; can correct later) [ ] Continue setting hostname and complete installation as usual except for setting the timezone manually
Next we proceed with booting and setting an additional kernel boot parameter. If you already had ubuntu installed, proceed from here.
[ ] Start booting the system [ ] When GRUB menu (GNU GRUB v2.02) is visible, select to edit the boot options <e> [ ] append to the end of the line starting with "linux" iommu=soft [ ] continue booting with the modified options: <F10> [ ] login [ ] confirm that the nommu_map_single error is gone dmesg | grep nommu [ ] if you configured networking manually correctly, confirm that LAN is up ip addr ping 22.214.171.124
If needed, correct the interfaces configuration. Edit /etc/network/interfaces
sudo vi /etc/network/interfaces
It should contain something like this, which is the minimum you need. You can also delete the indented lines, and replace static by dhcp to obtain the configuration through DHCP.
# The primary network interface auto enp3s0 iface enp3s0 inet static address xx.yyy.zzz.123 netmask 255.255.255.0 dns-nameservers xx.yyy.zzz.1
Persisting the fix
[ ] login, and edit /etc/default/grub sudo vi /etc/default/grub [ ] Move cursor to insertion point between the quotes of GRUB_CMDLINE_LINUX_DEFAULT="" [ ] enter insert mode <i> [ ] and insert the following iommu=soft [ ] Save and exit <Esc><:><q><w><Enter> [ ] Regenerate the grub.cfg file sudo grub-mkconfig -o /boot/grub/grub.cfg [ ] Reboot sudo reboot now
From now on the system boots with the added parameter.
updated: 20171207; 20171231