Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-09-2008, 03:48 PM   #1
LQ Newbie
Registered: Dec 2008
Posts: 2

Rep: Reputation: 0
Question How to change ifcfg-ethX names to a new name like ifcfg-switchname

I am running a special appliance made for capturing network traffic. So the box has alot of extra network ports in it to connect to various switches in my network. It is running Red Hat Enterprise Linux Server release 5.1 (Tikanga).My question is i want to change the interface names so that they represent the switch they are connected to.
Example. ifcfg-eth3 but i want ifcfg-switchname.
I have read to change the files name in /etc/sysconfig/network-scripts from ifcfg-eth3 to ifcfg-switchname. Then edit that file to
File name = ifcfg-switchname
HWADDR=00:00:00:00:00:00 (the MAC for that NIC)

Then a reboot would be the only thing to apply these new names. I do a reboot then it sets all the files and names back to the original name. So I edit the /boo/grub/menu.lst file to have PERSIST at the end of the kernal string. However this does not work and all the names still convert back to the original. Any Help or advice would be great help.

Old 12-09-2008, 04:59 PM   #2
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45

Guess you might need to modify modprobe.conf as well, so that the interface name relates to the right driver.
Old 12-09-2008, 09:25 PM   #3
LQ Newbie
Registered: Dec 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the reply,

All I see is this so I am not sure what i would need to modify.

[root@localhost etc]# more modprobe.conf
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptspi
alias scsi_hostadapter2 ata_piix
Old 12-14-2008, 05:09 PM   #4
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
Ok I'm manged to make it work on a Cent OS 5.2 system so the same should apply to Redhat 5.x (Since they are the same base). I renamed my interface from eth0 to prod (for production network)

Here's some of my ifconfig output

prod Link encap:Ethernet HWaddr 08:00:27:4C:A3:53
inet addr: Bcast: Mask:

Heres' how I did it, firstly rename the interface

1) Rename /etc/sysconfig/network-script/ifcfg-eth0 to /etc/sysconfig/network-script/ifcfg-prod
2) edit /etc/sysconfig/network-script/ifcfg-prod and change device=eth0 to device=prod

Now we must ensure that the system knows which hardware driver to use for our interface.

3) my modprobe.conf had the following entry, so I commented it out and created a new one

#alias eth0 pcnet32
alias prod pcnet32

This tells the system to use the pcnet32 driver and assign it to prod.

Finally reboot, and all should work.

Of course you need to change your modprobe.conf to reflect the correct driver, this is the driver used on my test system so would not work on yours.


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
Why my ifcfg-eth1 file have the extension .bak (ifcfg-eth1.bak) cmx08 Linux - Networking 4 08-23-2008 08:28 AM
kudzu overwrite the ifcfg-ethX files !!! shaybery Red Hat 1 06-15-2008 09:38 PM
fedora/redhat: ifcfg-eth0 and ifcfg-eth1 Shaun2222 Linux - Networking 9 01-23-2008 04:25 PM
How to change /etc/sysconfig/network-scripts/ifcfg-eth0 ariana Linux - Networking 1 05-01-2005 02:37 PM
"ifcfg-ethx" and "network-functions" files peok Linux - Networking 12 08-13-2003 07:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:43 AM.

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