Add a second IP to a single network interface in CENTOS

NewImage

If you would like to permanently assign multiple IP addresses to an interface, create corresponding configuration files in /etc/sysconfig/network-scripts.

$ sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0:1
DEVICE=eth0:1
BOOTPROTO=static
IPADDR=192.168.0.5
NETMASK=255.255.255.0
ONBOOT=yes

Once you have created as many configuration files as IP addresses to assign, restart network to activate IP aliasing.

$ sudo /etc/init.d/network restart

Advertisements


Categories: Linux, Networks, Open source

Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: