[root@rhce-ryanrudolf]# rm -rf / 2> /dev/null

things I break/fix for fun and learning

Feb 20, 2018 - 2 minute read - Comments

New NIC to the Rescue

Earlier today, I wasn’t able to access my homeserver externally. I thought maybe the LAN cable just got disconnected, or worse the power cord of the server got disconnected. When I got home, I immediately tested if I am able to access the homeserver from my internal LAN.

I tried to ping the server and it is not responding. Upon investigation, server is powered ON and link lights are ON for the NIC (network interface card). I tried reseating the LAN cable but no go, server still not responding to ping. I tried changing the connection to DHCP from static and it won’t pull an IP, and if I set it back to static still nothing. I’ve rebooted my router and switch still same. Restarted network services still no go. Only tihng to do is to reboot the server itself, but the uptime of 67days leaves me not to do it. I just assumed that the internal NIC is busted.

Last Christmas, I ordered several USB NICs. Now is the best time to test them! I first tested the Gigabit USB NIC and it works ok, no drivers needed (already built in to the Linux kernel). I then tested the 100Megabit NIC and it works flawless too! No need to install drivers and truly plug and play! I connected the LAN and it automatically grabbed a DHCP IP. Since this is my server and port forwarding has already been configured at the router level, I don’t want it to get a DHCP IP but instead a static IP. NMCLI to the rescue! I’ve been practicing for RHCSA and one of the things covered is setting up an iterface for DHCP / STATIC IP. So I just issued this commands to accomplish the task -

nmcli dev status (to get the interface name of the USB NIC)

nmcli con add con-name enp0s29f0u1 ifname enp0s29f0u1 type ethernet ipv4.method manual ipv4.addresses ipv4.gateway ipv4.dns

nmcli con del enp6s0 (remove the old NIC settings)

nmcli con up enp0s29f0u1 (activate the USB NIC) systemctl restart network

and there ya go! Setting up a static IP address via nmcli (network manager command line).

USB NIC in action!

Main server Lenovo Y410 with 4GB RAM, 500GB HDD and CentOS 7.x (webserver, seedbox, FTP and PXE server)

Secondary server Thinkpad T43 (unused)

DLINK DIR-615 running latest OpenWRT (LEDE 17.01.4)

DLINK DIR-628 (backup)

Like this page? Share it!