LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-19-2014, 12:10 PM   #1
linuxmantra
Member
 
Registered: Dec 2013
Posts: 104

Rep: Reputation: Disabled
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.
 
Old 05-19-2014, 12:51 PM   #2
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,324
Blog Entries: 1

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
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.
 
Old 05-19-2014, 01:09 PM   #3
linuxmantra
Member
 
Registered: Dec 2013
Posts: 104

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Shadow_7 View Post
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/????
 
Old 05-19-2014, 02:43 PM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,324
Blog Entries: 1

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
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.

Last edited by Shadow_7; 05-19-2014 at 03:05 PM.
 
Old 05-19-2014, 04:52 PM   #5
linuxmantra
Member
 
Registered: Dec 2013
Posts: 104

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Shadow_7 View Post
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.
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 09:31 PM.
 
Old 05-20-2014, 04:33 AM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 2,324
Blog Entries: 1

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
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/*
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename network interface (Rename ppp0 ...) Nicolas1390 Linux - Newbie 2 08-08-2011 03:14 AM
How to prevent auto up an interface at /etc/network/interface file ? Joydeep Bakshi Linux - Networking 8 07-28-2011 03:43 AM
How NET_TX_SOFTIRQ select network interface when multiple interface exits Mr.J Linux - Kernel 0 06-02-2009 12:17 PM
Rename or change an ethernet interface gw1500se Mandriva 3 11-29-2008 05:57 PM
SLIP, rename interface haxcess Linux - Networking 0 01-18-2005 04:35 AM


All times are GMT -5. The time now is 08:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration