[CentOS] Renaming NIC name in CentOS 7

Richer, Mark (CIV) mhricher at nps.edu
Fri Oct 3 19:31:36 UTC 2014


Of course, I found a page with a solution that worked right after sending the last email.  However, without pointing to me to search for pages in google on reloading udev rules, I wouldn’t have found this so thanks to the list for the collaborative solution.

http://askubuntu.com/questions/82470/what-is-the-correct-way-to-restart-udev

My comments are in [ ]s under some of the steps the author wrote.

This excerpt had the magic sauce I needed — it added a step to modprobe the driver module for the 10g NIC before reloading the udev rules.

The author wrote:


You have to combine all the advice given here in the right order:

  1.  Bring down the network service networking stop  [Comment: I skipped this, on CentOS 7, I would use systemctl stop network but it stopped already and I couldn’t restart it — however, the interfaces worked, maybe because NetworkManager is also still running?]
  2.  Unload the driver module from the kernel
     *   Find the name of the module lspci -v and look for "Kernel driver in use:"
     *   modprobe -r <driver module> [This was critical. I did lspci -v to find the 10G card and saw the driver module is called ixgbe].
  3.  Reload the udev rules udevadm control --reload-rules
  4.  Trigger the new rules udevadm trigger
  5.  Load driver modprobe <driver module>
  6.  Restart the network service networking start

[Very interesting but now when I did systemctl restart network, it worked. The modprobe commands, at least the first one, was critical to both allowing the service to start up again and to change the device name I see in ifconfig and elsewhere.]

  1.  (optional) Re-run any iptables scripts that referenced the eth interface name before it was up.

I suspect either step 4 or step 5 isn't really needed, but these steps worked for me. You could check after step 4 with step 2.1 to see if the trigger command already did step 5, edit this answer to reflect your findings if you do.

[Above is the poster’s comments … maybe I’ll try to skip 4 and 5 on the next server I execute this procedure on, but I need to leave so I’ll let you know later.]

Cheers!
Mark

MARK H RICHER, MS CS
NPS-NCR Digital Forensics Lab IT Manager
Computer Science Department
Naval Postgraduate School - National Capital Region (NCR)
900 N Glebe Rd, Rm 5-182, Arlington, VA 22203
571.858.3254 (o) 571.303.9498 (m) mhricher at nps.edu<mailto:mhricher at nps.edu>



On Oct 3, 2014, at 3:11 PM, Richer, Mark (CIV) <mhricher at nps.edu<mailto:mhricher at nps.edu>> wrote:

Thanks to everyone who responded. This led to some interesting reading and learning, but it hasn’t avoided the reboot.

I found this page on udev:
How to reload udev rules without reboot?<http://unix.stackexchange.com/questions/39370/how-to-reload-udev-rules-without-reboot>
http://unix.stackexchange.com/questions/39370/how-to-reload-udev-rules-without-reboot

Sounds perfect for my question, but at least one server I tried all the suggestions on, it didn’t change anything. A reboot is a “magic sauce,” but it’s nice to know how to avoid this with servers. If I find another solution that works for me, I’ll post it.

Mark

MARK H RICHER, MS CS
NPS-NCR Digital Forensics Lab IT Manager
Computer Science Department
Naval Postgraduate School - National Capital Region (NCR)
900 N Glebe Rd, Rm 5-182, Arlington, VA 22203
571.858.3254 (o) 571.303.9498 (m) mhricher at nps.edu<mailto:mhricher at nps.edu>



On Oct 3, 2014, at 1:16 PM, Robert Moskowitz <rgm at htt-consult.com<mailto:rgm at htt-consult.com>> wrote:


On 10/03/2014 12:38 PM, Darr247 wrote:
On 03 October 2014 @13:53 zulu, Digimer wrote:
On 03/10/14 09:12 AM, Richer, Mark (CIV) wrote:
All,

I am trying to understand better how you give an interface a more descriptive name and get it all working without a reboot, if possible.

I actually wrote a small tutorial on how to do just this.

https://alteeve.ca/w/Changing_Ethernet_Device_Names_in_EL7_and_Fedora_15%2B


I think you missed the "without a reboot" part.  :)

Supposedly you can restart udev and then networkservices


_______________________________________________
CentOS mailing list
CentOS at centos.org<mailto:CentOS at centos.org>
http://lists.centos.org/mailman/listinfo/centos

_______________________________________________
CentOS mailing list
CentOS at centos.org
http://lists.centos.org/mailman/listinfo/centos




More information about the CentOS mailing list