Twitter TweetsRecent FAQ'sMailing ListNewsAzerTech.net News FeedThe 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?
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:
In this case, the original lines would be: DEVICE=eth0 You want to edit them to read: DEVICE=eth0: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:
|

