I am wondering what is the difference between:# ifconfig eth0:0 1.1.1.1/24and just# ip addr add 1.1.1.1/24 dev eth0Btw I cannot do# ip addr add 1.1.1.1/24 dev eth0:0RTNETLINK answers: File existsIn 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:ffinet 1.1.1.1/24 brd 1.1.1.255 scope global eth0:0 ---> with ifconfiginet 2.2.2.2/24 scope global eth0 ----> with ipWhen should I prefer the first way and when should I prefer the second way? It seems more cool to
Difference between virtual interfaces with ifconfig and iproute2
networking;interface
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 1.1.1.1/24 dev eth0 label eth0:0you 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.