Setting up two IP address on one NIC
This is a small how-to to set up two are more IP address on single LAN card. There are some times which require two IP address to set up so that we can make a Linux box as a router. This can be possible without even having two NIC cards. We can configure two different IP address on single Network Card as shown below.
Setting up 2 IP address on “One” NIC. This example is on ethernet.
STEP 1:Setting up first IP address. Edit /etc/sysconfig/network-scripts/ifcfg-eth0 on Redhat Linux box and give the following entries as shown.
STEP 2: Setting up second IP address. Create one file as /etc/sysconfig/network-scripts/ifcfg-eth0:1 and give the entries as below in to this file.
STEP 3: Once you configure above files and save them. Now reload the network service on your machine.
service network reload
STEP 4: Check if you get the IP address assigned to the eth0 and eth0:1 interfaces respectively.
Note1: We can assign virtual IP to the same interface with ifconfig but that one is not permanent so not giving info on that.
Note2: We can assign up to 16 virtual IP address to a single NIC card.
The following two tabs change content below.
My name is Surendra Kumar Anne. I hail from Vijayawada which is capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. I work with ICE systems, Sydney as Sr. Consultant. You can contact me at surendra (@) linuxnix dot com.