How to Add Extra IP to Interface in Linux (CentOs)


root in or su to root and then:

# cd /etc/sysconfig/network-scripts

To add an extra IP to eth0, type:

# vi ifcfg-eth0:1

And Add this (changing IP as required).

DEVICE=eth0:1
BOOTPROTO=static
IPADDR=192.168.0.5
ONBOOT=yes

/etc/sysconfig/network-scripts/ifcfg-eth0:1

DEVICE=eth0:1
BOOTPROTO=static
IPADDR=192.168.0.5
ONBOOT=yes

Note: If you want to add additional IP's to eth0, eth1, etc -- simply create the corresponding file ifcfg-ethx:x and so on...


Comments

Please login to comment