N090905-Muliple IP addresses


Having multiple IP addresses on the same Network Interface Card (NIC) can be useful in situations where you need to specify specific access controls or when you need to ensure that some resources are only available internally.

POSEX Compliant
For this example the REDHAT LINUX based operating system will be used.
  1. As root change directory to cd /etc/sysconfig/network-scripts/ by issuing the commend below:
        cd /etc/sysconfig/network-scripts/

  2. Copy the file for the network card you wish to have multiple IP addresses on. In this case we are using ifcfg-eth0 as shown below:
        cp ifcfg-eth0 ifcfg-eth0:1

  3. Edit the file ifcfg-eth0:1 changing the lines indicated below
    # Intel Corporation 82557/8/9 Ethernet Pro 100
    DEVICE=eth0:1                 <---Same as file name
    HWADDR=00:02:a5:8b:40:96      <---This must NOT change
    ONBOOT=yes
    BOOTPROTO=none
    NETMASK=255.255.255.0
    IPADDR=192.168.1.15           <---This must be unique
    GATEWAY=192.168.1.1
    TYPE=Ethernet
    
  4. Restart the network by issuing the command below:
        service network restart

  5. Check you work by issuing the command below:
        ifconfig

    With this method you can assign up to 255 IP addresses to the same NIC.


    Articles
    Networking

    N090307-Duplex Mismatch
    N090905-Multi_IP
    N090825-Clear_ARP
    N20110904-Mask_table
    N091010-ASA_WCCP_LINUX
    N20110930-MRTG
    Servers

    W090905-DHCP-Options
    L091028-Crontab
    L100519 Linux Files 1
    S121220-xymon_cc
    Misc.

    M110419-Testing EMAIL
    M20110818 - Malware Education

eSubnet Fragment

Receive insights into networking, security
and IT management from our newsletter