IP
addresses to an interface. The command takes the following form: ip addr [ add | del ] address dev ifname
IP
address to an interface, issue a command as root
as follows:
~]#Further examples and command options can be found in theip address add 10.0.0.3/24 dev eth0
The address assignment of a specific device can be viewed as follows: ~]#ip addr show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether f0:de:f1:7b:6e:5f brd ff:ff:ff:ff:ff:ff inet 10.0.0.3/24 brd 10.0.0.255 scope global global eth0 valid_lft 58682sec preferred_lft 58682sec inet6 fe80::f2de:f1ff:fe7b:6e5f/64 scope link valid_lft forever preferred_lft forever
ip-address(8)
manual page.
~]#ip address add 192.168.2.223/24 dev eth1
~]#ip address add 192.168.4.223/24 dev eth1
~]#ip addr
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:fb:77:9e brd ff:ff:ff:ff:ff:ff inet 192.168.2.223/24 scope global eth1 inet 192.168.4.223/24 scope global eth1
ip(8)
manual page.
Note