There was a problem loading the comments.

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

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

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...


Share via

Related Articles

© 8Dweb LLC