Mailing List

To join my mailing list,
enter your email address
and press Subscribe:

News

AzerTech.net News Feed

The Software Development Cycle
When BNT Solutions (http://www.bnt-solutions.net/) was incorporated in 2001 there was one goal in particular that ran as a thread through...



Introduction to Networking
The very first time I tried to setup a server at home I discovered something unexpected: What I thought was going to...



Subscribing to a Mailman list from any web page
It happens quite often that you want people to be able to subscribe to your Mailman mailing list from a...


Montreal Family

Time for Canadians to speak!
The Government of Canada has begun a nationwide series of consultations on copyright modernization.



Linked-In for business and pleasure
The Linked-In crowd will try to convince you that their service is good for business. This is more...



A sad day for free speech and copyright law
Here is some important, well written commentary from William Patry and, in response, Pamela Jones of Groklaw. First, illiam Patry explains why he...


How do you assign an additional IP to a NIC?
Print 
There are cases where you need more than one IP on a server. How do you assign a second IP to a Network Interface Card? In Redhat-based distributions there is a directory, /etc/sysconfig/network-scripts/, that contains configuration files for each network device (such as ifcfg-eth0 for the first ethernet card.)

The easy way to assign a second IP to one of these cards is to make a copy of the file, alias the device name and change the IP. For example: Let's say that eth0 is configured for the IP 192.168.1.1 and you also want it to listen to IP 192.168.1.2. Here's what you do:

First, cd to the network-scripts directory:

# cd /etc/sysconfig/network-scripts/

Next, make a copy of the configuration file:

# cp ifcfg-eth0 ifcfg-eth0-2

Now edit the file. There are only two lines that you really need to change:

  • You need to update the device= line to give an alias name to the device and
  • You need to change the IP= line to reflect the desired IP.

In this case, the original lines would be:

DEVICE=eth0
...
IP=192.168.1.1

You want to edit them to read:

DEVICE=eth0:2
...
IP=192.168.1.2

That's all! Save your changes and restart your network:

# service network restart

Now, when you check your network configuration you will find an extra device with the new IP:

eth0 Link encap:Ethernet ... inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0 ... eth0:2 Link encap:Ethernet ... inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0 ...
Tags
0% of 0 voters found this FAQ useful,  I found this FAQ  useful useful  not useful not useful
Next >

Powered by EasyFAQ © 2006 Joomla-addons.org