Peeyush Maurya's Technical Guide for an interface for multiple IP addresses


Configuration tools

There are many network configuration tools today. They are:

netconf :: A GUI interactive interface available on Redhat 6.1
linuxconf :: A GUI interactive interface available on Redhat 6.1 which includes netconf configuration.
netconfig :: A GUI step by step interface
ifconfig ::A text based program to configure the network interface. Type "man ifconfig" for info.

These programs will modify values in the following files:

/etc/sysconfig/network :: Defines your network and some of its characteristics.
/etc/HOSTNAME :: Shows the host name of this host. IF your name is "myhost" then that is exactly the text this file will contain.
/etc/resolv.conf :: Specifies the domain to be searched for host names to connect to, the nameserver address, and the search order for the nameservers.
/etc/host.conf :: Specifies the order nameservice looks to resolve names.
/etc/hosts :: Shows addresses and names of local hosts.
/etc/networks :: Provides a database of network names with network addresses similar to the /etc/hosts file. This file is not required for operation.
/etc/sysconfig/network-scripts/ifcfg-eth* ::There is a file for each network interface. This file contains the IP address of the interface and many other setup variables.

Configuring an interface for multiple IP addresses

If you want to configure your network card to act as more than one IP address, issue the following command:

ifconfig dummy 192.168.1.102 netmask 255.255.255.0

This uses the dummy system interface capability supported in the kernel to setup another virtual interface which operates at IP address 192.168.1.102. Substitute the IP address that you want your virtual interface to be with an appropriate netmask for your network. To disable this, issue the following command.

ifconfig dummy down

Another way to use multiple IP addresses on one ethernet card is to set up a new file in your /etc/sysconfig/network-scripts directory. Copy your ifcfg-eth0 role to ifcfg-eth0:0.

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

Edit that file and rename the device to "eth0:0" and the IP address to the desired IP address. You may also want to modify BROADCAST, NETWORK, or NETMASK. You can continue adding IP addresses by using :1, :2, etc such as ifcfg-eth0:2.

vi /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.102
NETMASK=255.255.255.0
GATEWAY=192.168.0.1

To make it effective, you must reboot your system or issue the command "/etc/rc.d/init.d/network restart" as root.

Now run 'ifconfig' and you will see the status for the new IP address you had added. From any othe rcomputer on your network 'ping 192.168.0.102' .. You will get reply...

Few related link:

Multiple IP Addresses per Ethernet Card

Please mail any good link related to this topic

Back to main page  

 
..