Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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>
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.
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.
Yes I am using udev. How to purge the rule from /etc/udev/rules.d/????
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.
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.
Since I was building physical server, there is 4 slots for NIC card, earlier due to issue in NIC card, we called HP service man and replaced all the NIC because problem was in NIC card which was identified by ahs report generated by ILO. So, when the hp's service man changed the NIC card, I see 8 network interface starting from eth0 to eth7. so, finally, what I did is, I rebuild the server again and all problem was solved, Now I can see only 4 network interface eth0 to eth3 and I configured the network in eth0. Rebuilding server leads to resolve my issue.
Last edited by linuxmantra; 05-19-2014 at 08:31 PM.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.