- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- how to Rename a NIC, in rhel 3/4/5
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-28-2007 08:07 PM
тАО06-28-2007 08:07 PM
here is the howto
http://www.novell.com/coolsolutions/tip/19154.html
[ PLZ RATE THIS TIP .. thanx in anticipation ;) ]
is there anything equivalent in rhel 3/4/5
i.e eg i have two nics(eth0, eth1).. and I dont want to access these nics as eth0, and eth1... but I want to access eth0 as wan0, and eth1 as lan0
i.e
# ifdown lan0.. instead of eth1
# ifup lan0.. instead of eth1
# ifdown wan0.. instead of eth0
# ifup wan0.. instead of eth0
Regards
Maaz
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2007 12:22 AM
тАО06-29-2007 12:22 AM
SolutionYou can:
Use the GUI tool (system-config-network) and manipulate the device -vs- network "nickname"
Or just rename the files as desired and "service network restart"
You will now be able to manipulate the device via that name - HOWEVER - the output of ifconfig/ip will always show the actual eht* hardware data.
If you want the output of ifconfig/ip to show "lan0" or "wan0" you have to edit the ifcfg-"filename" and do 2 things:
1) change the DEVICE line
2) include the HWADDR
[root@cluster1 network-scripts]# cat ifcfg-lan0
DEVICE=lan0
HWADDR=00:19:BB:3B:DA:1C
E.G.:
(my output is slightly manipulated because of remote connectivity, the the idea is the same)
[root@cluster1 sysreport]# cd /etc/sysconfig/network-scripts/
[root@cluster1 network-scripts]# ls ifcfg-eth*
ifcfg-eth0 ifcfg-eth3
[root@cluster1 network-scripts]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:17:A4:77:00:08
eth1 Link encap:Ethernet HWaddr 00:17:A4:77:00:0A
eth2 Link encap:Ethernet HWaddr 00:19:BB:3B:DA:1B
eth3 Link encap:Ethernet HWaddr 00:19:BB:3B:DA:1C
[root@cluster1 network-scripts]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth3: [ OK ]
[root@cluster1 network-scripts]#
[root@cluster1 network-scripts]# mv ifcfg-eth3 ifcfg-wan0
[root@cluster1 network-scripts]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface wan0: [ OK ]
Now if I edit the file and change the device data:
[root@cluster1 network-scripts]# ls ifcfg-*
ifcfg-eth0 ifcfg-lan0
(vi file here)
[root@cluster1 network-scripts]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:17:A4:77:00:08
lan0 Link encap:Ethernet HWaddr 00:19:BB:3B:DA:1C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2007 01:41 AM
тАО06-29-2007 01:41 AM
Re: how to Rename a NIC, in rhel 3/4/5
You can find the rules in /etc/udev/rules.d
just "grep eth0 *" in there (name of the file containing the network rulesets could be different, I've seen it been called 30-net_persistent_names.rules and others. If you do not have a match there, you can create a file yourself, ie: 30-net_persistent_names.rules with the following lines in there:
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:18:fe:dd:b1:a1", IMPORT="/lib/udev/rename_netiface %k eth0"
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:18:fe:dd:b1:a2", IMPORT="/lib/udev/rename_netiface %k wan0"
When rebooting (or restarting udev & networking) the devices will be permanently renamed (for as long as you keep that entry in the udev rulesets)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2007 01:50 AM
тАО06-29-2007 01:50 AM
Re: how to Rename a NIC, in rhel 3/4/5
The same applies in RHEL5. You can add similar udev rules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2007 06:08 PM
тАО06-29-2007 06:08 PM
Re: how to Rename a NIC, in rhel 3/4/5
one of my friend has report me the following, will also work in rhel 5.
No of NIC: 1
Default Device Alias: eth0
New Device Alias: lan0
STEPS:
-----
1. Open /etc/sysconfig/hwconf
And Change "device: eth0" to as given bellow
------------------------
class: NETWORK
bus: PCI
detached: 0
device: lan0 ### here
driver: 3c59x
desc: "3Com Corporation 3c905B 100BaseTX [Cyclone]"
network.hwaddr: 00:50:04:99:c4:1d
.
.
.
----------------------------------
2. open /etc/modprobe.conf
And Change eth0 to lan0
Change from
alias eth0 3c59x
To
alias lan0 3c59x
Save and Exit.
3. Change the name of
/etc/sysconfig/network-scripts/ifcfg-eth0 file to
/etc/sysconfig/network-scripts/ifcfg-lan0
mv /etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network-scripts/ifcfg-lan0
4. Reboot System.
and its DONE
(yet I haven't check the above steps)
Regards
Maaz