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 dev eth1
ip link set eth1 up

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

The second line, brings the link up.