How to move eth devices on Oracle Linux 6.x

When you install more than 1 Linux server at a site, it often happens that the patched interfaces get a different interface name. I’ll try to explain in this blogentry how to get them renamed correctly.

What we want

eth0      LAN 1Gb
eth1      LAN 1Gb
eth2      STORAGE 10Gb
eth3      STORAGE 10Gb

What we have

We installed 3 brand new servers and when we detect the interfaces :

# ifup eth0-9
# ethtool eth0-9

It results in the following mixed up configuration

– Server A

eth0      LAN 1Gb
eth1      LAN 1Gb
eth2      STORAGE 10Gb
eth3      STORAGE 10Gb

– Server B

eth2      LAN 1Gb
eth3      LAN 1Gb
eth8      STORAGE 10Gb
eth9      STORAGE 10Gb

– Server C

eth2      LAN 1Gb
eth3      LAN 1Gb
eth4      STORAGE 10Gb
eth5      STORAGE 10Gb

How To Correct it?

1) Adjust the /etc/udev/rules.d/70-persistent-net.rules file by interchanging the interfacenames. ( f.e. change eth2 to eth0 and viceversa )
2) Adjust the mac adress in the ifcfg-ethx config files in /etc/sysconfig/network-scripts.
3) reboot

Hope this helps somebody.

Advertisements