Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I am wondering what is the difference between:

# ifconfig eth0:0

and just

# ip addr add dev eth0

Btw I cannot do

# ip addr add dev eth0:0
RTNETLINK answers: File exists

In ip addr show it appears differently :

eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 
link/ether 8c:ae:4c:fe:1f:75 brd ff:ff:ff:ff:ff:ff
inet brd scope global eth0:0 ---> with ifconfig
inet scope global eth0 ----> with ip

When should I prefer the first way and when should I prefer the second way? It seems more cool to

share|improve this question
On Linux you should always prefer the iproute2 tools (like ip) and avoid the net-tools (like ifconfig), net-tools are deprecated. This does not hold true for other operating systems, though. For information in the thread net-tools future. – Marco Aug 22 '13 at 21:32
I know it is deprecated, I was just wondering if the two commands has the same result or not. Thanks for the thread is looks interesting. – emma sculateur Aug 22 '13 at 21:38
If you insist on labels you can do it with ip as well: ip addr add label eth0:0 dev eth0 – dsmsk80 Aug 23 '13 at 7:00

1 Answer 1

In Linux, use the ip commands. In other OSes, use ifconfig and family.

If you use the iproute2 way (ip) as such:

ip addr add dev eth0 label eth0:0

you should have the same effect as your first ifconfig command, and should even be displayed the same way by ifconfig. As mentioned, in Linux, you should prefer the ip family of commands over ifconfig, route, etc. Though ifconfig and others will remain a stable in network admin's diets for a while to come because of their wide usage and support in non-Linux OSes as well.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.