I just installed Rocky Linux 8 (8.6) on a server that has two network interfaces. The first one, enp3s0 uses dhcp to get an address from my home network. All of my other systems get a address like 192.168.4.XXX. However, my system is now getting an address of 192.168.5.XXX. As a result I can’t access the Internet. The highlights of the configuration are:
BOOTPROTO=dhcp
ONBOOT=yes
which was created during installation. I checked after installation and I could access the Internet.
Then I configured my network interface, ep0s20u9, which is a Ethernet card plugged into a USB port (I don’t have open slots on the system not a second Ethernet port). I just created the file /etc/sysconfig/network-scripts/ifcfg-enp0s20u9. I configured that interface as a static interface withe following highlights.
The network-scripts/ifcfg-xxx files are no longer used, they are legacy. Rocky 8 does allow a package called network-scripts to be installed to get the legacy scripts but it probably won’t do too much. Network connections are configured using Network Manager and this is how network connections should be configured now. You can use nmtui which has an ncurses style console graphical configuration tool, or you can use nmcli to configure your network card.
Thanks! Let me give it a whirl (I’ve reinstalled 3 times now and I can’t seem to figure out how to configure the second interface - frustrating as hell, but it’s my own fault).
Furthermore, if one of the connections has name “enp3s0”, then
nmcli connection show enp3s0
(which can be abbreviated to nmcli c s enp3s0 )
The output of that shows both the stored configuration (lower case) and active config (upper case), including the options that were received from DHCP server (if any).
Plain nmcli gives overview summary of devices, connections, routes, etc.