Rename network interface
I am building a physical server (DL 360 Gen 8). Since, I could not see the interface interface in iLO, HP service was called and they replaced the 4 new NIC card as per the ahu report generated by iLO. Now, I can see the 4 network interface when I type # ifconfig -a, eth4, eth5, eth6 and eth7. But when I type #ifconfig eth0, message appears as eth0:error fetching interface information: Device not found. Now how can I change the eth4 to eth0?
Also, Default things inside /etc/sysconfig/network-scripts/ifcfg-ethX are DEVICE= BOOPROTO= HWADDR= MTU=1500 UUID= <from where shall I get this> Thanks in advance. |
If you're using udev it generates them at first boot for a given hardware. If you migrate hardware with the same install you can purge the rule(s) from /etc/udev/rules.d/ and it will start counting from zero again. Otherwise you can edit the rule(s). That is IF you're using udev. It's /etc/udev/rules.d/70-persistent-net.rules on my debian system.
|
Quote:
|
For me:
# systemctl stop udev # rm /etc/udev/rules.d/70-persistent-net.rules # reboot You don't have to reboot, but if you don't, you have to modprobe -r the network nic drivers then modprobe them back before you restart udev. It's just simpler to reboot. With the reboot, stopping the udev might be optional. For sysV type systems it would be the "/etc/init.d/udev stop" type syntax. You could also modify the net.rules and do the reboot. There's stuff in /lib/udev/ that tells udev what guidelines to use for an initial creation and other options. Edit: There's also the ifdown type stuff to free up the modules to be unloaded if you don't reboot. |
Quote:
|
udev uses the next name when it sees the new network hardware. Since you changed hardware and the previous hardware took the first four slots, it assigned eth4+. A reinstall is one solution of course. Although the differences between the results may only be the contents of one file.
I have this issue often as I run linux from an SDHC card and move that card across multiple hardware options. I do what I previously listed so I don't have to change my firewall script to use a different interface. And otherwise have "ifconfig -a" list 10+ nics that doesn't apply to the current hardware. $ egrep -r -i "eth0" /etc/udev/* |
All times are GMT -5. The time now is 06:30 AM. |