I am wondering what is the difference between:
# ifconfig eth0:0 1.1.1.1/24
and just
# ip addr add 1.1.1.1/24 dev eth0
Btw I cannot do
# ip addr add 1.1.1.1/24 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 1.1.1.1/24 brd 1.1.1.255 scope global eth0:0 ---> with ifconfig
inet 2.2.2.2/24 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
ip) and avoid the net-tools (likeifconfig), net-tools are deprecated. This does not hold true for other operating systems, though. For information in the thread net-tools future.