Home \ Linux \ Enabling Multiple Ip Addresses per NIC on LINUX

Enabling Multiple Ip Addresses per NIC on LINUX

There are many times where you may need to quickly add multiple IP Addresses to a single network interface card (NIC)

Each interface is limited to 255 different ethernet devices per adaptor.

from the command line you can enter

ifconfig devicename:number ipaddress netmask yournetmask

so as root or a user with root permissions

ifconfig eth0:1 netmask

you can add this to the rc.local located in /etc/rc.d/  if you want this to take effect at boot

On Cent Os/ Redhat / Fedora

you can copy the /etc/sysconfig/network-scripts/ifcfg-eth0 to ifcfg-eth0:1

edit /etc/sysconfig/network-scripts/ifcfg-eth0:0

change the IPADDR= to your secondary address

Optionally, if you are adding disjointed ip addresses from a different network you may need to change BROADCAST, NETWORK, NETMASK, GATEWAY as well

Leave a Reply

Your email address will not be published. Required fields are marked *