introductioninstalling redhatunix commandsediting filesssh
sitemapapacheftptcp/ipmisc-notesresources

binding multiple ip addresses to one nic

If you have one network card and one ip address bound to that network card already, you would have a file in /etc/sysconfig/network-scripts called "ifcfg-eth0". This file contains the configuration for that network card. If you want to bind more than one ip address to the card you need to create an additional configuration file for each of ip addresses that you wish to add.


"# cd /etc/sysconfig/network-scripts"

create file ifcfg-eth0:X

Replace X with numerical value. Could use 1,2,3, etc. I use the last octet of the ipaddress it stands for. Example: "ifcfg-eth0:22" would be for "155.99.10.22". I just find that an easy method to keep trak of what address belongs to what file.

contents of file:

DEVICE=eth0:X #X must be a unique number, again I match the last octet of the ipaddress

IPADDR=XXX.XXX.XXX.XXX

Note: For multiple IP addresses you would create, for example of 3 aditional addresses: ifcfg-eth0:1, ifcfg-eth0:2 and ifcfg-eth0:3. In the line DEVICE=eth0:X replace the X with the corresponding number in the filename.

Look at /etc/sysconfig/network-scripts/ifcfg-eth0 for example.

starting, stopping and restarting ipaddresses and nic card bindings
To bring up a newly created address, "# /etc/sysconfig/network-scripts/ifup eth0:X"
You can also kill an individual ip address by "# /etc/sysconfig/network-scripts/ifdown eth0:X"
Or to restart you network card and re-initialize all addresses "/etc/init.d/network restart". Additional options for "network" are start, stop,restart, reload, status and probe.