Set IP address Linux Using ip command

Written by
Date: 2012-04-25 11:28:00 00:00


How to add or set the IP address in Linux using the ip command?

You better start getting used to use the ip command as some Linux distributions have started deprecating the ifconfig command.

So, if you want to set the IP in your Linux box, run:

ip addr add 10.1.1.2/16 dev eth1
ip link set eth1 up

The first line, sets the IP, be sure to replace "10.1.1.2/16" with the IP and mask bits, you need to use.

The second line, brings the link up.