Download your favorite Linux distribution at LQ ISO.
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 03-09-2011, 12:12 PM   #1
LQ Newbie
Registered: Mar 2011
Posts: 2

Rep: Reputation: 0
removing network alias

how to remove the network alias (ex: ifcfg-eth0:2)from RHEL5, i had deleted the ifcfg-eth0:2 file from /etc/sysconfig/network-scripts/ifcfg-eth0:3
but i can still see the entry in the graphical network configuration after i issued the command
system-config-network, i want to remove it from there. can any one help me please.
Old 03-09-2011, 08:02 PM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,569

Rep: Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426
That removes the on-disk cfg; now issue
service network restart
as root
Old 03-09-2011, 10:46 PM   #3
LQ Newbie
Registered: Mar 2011
Posts: 7

Rep: Reputation: 1
Rather than restarting 'network', you could additionally remove '/etc/sysconfig/networking/devices/ifcfg-eth0:2'. At least on my test host (CentOS 5.4), after removing that file, the interface was no longer displayed from 'system-config-network'. If you also need / want to remove the configured interface, try:
/sbin/ip address delete dev eth0:2
where is the IP_address and CIDR representation of the netmask in use ('/sbin/ip address show' can show IPAddr/CIDR). An example of dealing with logical interfaces can be seen here.
Old 03-10-2011, 03:24 PM   #4
LQ Newbie
Registered: Mar 2011
Posts: 2

Original Poster
Rep: Reputation: 0
thanks chrism01 and troysunix so much for help, but really i tried your commands but still shows me the same problem finally i mix the commands together as follows and it works:

1- remove the ip address:
#ip address delete dev eth0:2

2- remove the device:
#rm -f /etc/sysconfig/networking/devices/ifcfg-eth0:2

3- remove the file:
#rm -f /etc/sysconfig/network-scripts/ifcfg-eth0:2

then check the "system-config-network" command there is no eth0:2 any more.

thanks again i will not success with out your help.


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
port forwarding for network alias dlugasx Linux - Server 1 08-13-2009 11:53 AM
Network alias inaccessible externally javacougar Linux - Networking 0 05-28-2009 12:18 PM
how to remove network alias slackware pauledwards03 Linux - Wireless Networking 8 09-15-2008 01:41 PM
restart network after adding NIC alias blizunt7 Linux - Networking 1 06-06-2008 03:57 PM
Adding Network Interface alias from command line WireLine Fedora 2 06-09-2005 12:08 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:20 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration