ip link set not assigning IP Address but ifup does

majikman asked:

Since ip is set to replace ifconfig, I’m trying to get myself used to using the ip suite of commands. I’m trying to enable my NIC with

 ip link set eth3 up 

That doesn’t assign an IPv4 address correctly. However, if I run

 ifup eth3

it works fine. I’m not sure what exactly the issue is or where to start with this.

My answer:

ip link just manages the physical link layer. It has nothing to do with addresses.

To manage your addresses, use ip address. For instance:

ip addr add dev eth3
ip addr add 2001:db8:64ce:c633::2/64 dev eth3

And similarly for routes:

ip route add default via dev eth3
ip route add default via 2001:db8:64c3:c633::1 dev eth3

You will find, on close inspection, that these are the commands your distribution’s networking scripts are using.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.