Add multiple IP Address CentOS

Posted by cikul | Posted in Linux | Posted on 02-12-2013-05-2008

0

In Linux, we can add more than 1 IP Address in single ethernet device. To adding more IP address we must add new IP in network device configuration file,


nano /etc/sysconfig/network-scripts/
 

For example we want to add IP 172.1.1.3 to existing server (IP 172.1.1.2)


DEVICE=eth0
 HWADDR=xx:xx:xx:xx:xx:xx
 TYPE=Ethernet
 UUID=762edc54-4458-44da-a400-16bd0a536ae1
 ONBOOT=yes
 NM_CONTROLLED=yes
 BOOTPROTO=static
 NAME="System eth0"
 IPADDR=172.1.1.2
 NETMASK=255.255.255.0
 GATEWAY=172.1.1.1
 IPADDR2=172.1.1.3
 NETMASK2=255.255.255.0
 GATEWAY2=172.16.4.1

the configuration for other IP are had number (ex : IPADDR2, NETMASK2, etc), if finish, save the file and reload network service


[root@server]# service network restart
 Shutting down interface eth0:                              [  OK  ]
 Shutting down loopback interface:                          [  OK  ]
 Bringing up loopback interface:                            [  OK  ]
 Bringing up interface eth0:                                [  OK  ]

Share and Enjoy

Write a comment

*