Nicolas Kovacs
2016-May-27 09:09 UTC
[CentOS] Redefine ethX interface names in CentOS 5.11?
Hi, I have a LAN server running CentOS 5.11 with two NICs eth0 and eth1. I'd like to swap the interface names, but I don't know how to go about that under CentOS. Here's what I would do on a Slackware server (I have one next to me in my office). Open /etc/udev/rules.d/70-persistent-net.rules and edit it: # PCI device 0x8086:/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0 (e1000e) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:22:64:8a:4c:c2", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" # PCI device 0x8086:/sys/devices/pci0000:00/0000:00:02.0/0000:02:00.0 (e1000e) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="2c:27:d7:15:54:a1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" To swap interfaces, I simply have to switch the respective NAME="ethX" attributes and restart the server. How would you do something similar on a machine running CentOS 5.11? Cheers, Niki -- Microlinux - Solutions informatiques durables 7, place de l'?glise - 30730 Montpezat Web : http://www.microlinux.fr Mail : info at microlinux.fr T?l. : 04 66 63 10 32
James Pearson
2016-May-27 10:44 UTC
[CentOS] Redefine ethX interface names in CentOS 5.11?
Nicolas Kovacs wrote:> Hi, > > I have a LAN server running CentOS 5.11 with two NICs eth0 and eth1. I'd > like to swap the interface names, but I don't know how to go about that > under CentOS. > > Here's what I would do on a Slackware server (I have one next to me in > my office). > > Open /etc/udev/rules.d/70-persistent-net.rules and edit it: > > # PCI device 0x8086:/sys/devices/pci0000:00/0000:00:04.0/0000:03:00.0 > (e1000e) > SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", > ATTR{address}=="00:22:64:8a:4c:c2", ATTR{dev_id}=="0x0", > ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" > > # PCI device 0x8086:/sys/devices/pci0000:00/0000:00:02.0/0000:02:00.0 > (e1000e) > SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", > ATTR{address}=="2c:27:d7:15:54:a1", ATTR{dev_id}=="0x0", > ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" > > To swap interfaces, I simply have to switch the respective NAME="ethX" > attributes and restart the server. > > How would you do something similar on a machine running CentOS 5.11?Have you tried swapping the HWADDR lines in /etc/sysconfig/network-scripts/ifcfg-eth0 and ifcfg-eth1 ? No idea if will work ... James Pearson
Nicolas Kovacs
2016-May-27 10:58 UTC
[CentOS] Redefine ethX interface names in CentOS 5.11?
Le 27/05/2016 ? 12:44, James Pearson a ?crit :> Have you tried swapping the HWADDR lines in > /etc/sysconfig/network-scripts/ifcfg-eth0 and ifcfg-eth1 ? > > No idea if will work ...I gave it a try. Worked like a charm. Thanks very much. Niki -- Microlinux - Solutions informatiques durables 7, place de l'?glise - 30730 Montpezat Web : http://www.microlinux.fr Mail : info at microlinux.fr T?l. : 04 66 63 10 32
Possibly Parallel Threads
- Traditional network interface naming scheme vs. persistent naming
- Redefine ethX interface names in CentOS 5.11?
- future modprobe.conf
- CentOS 7 : network interface renamed from eth0 to eth1 after reboot
- CentOS 7 : network interface renamed from eth0 to eth1 after reboot