|
How do you assign an additional IP to a NIC?
Saturday, 29 March 2008There 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:
|
Mailing List |
Copyright © 2012 by AzerTech.net, All rights reserved.
Powered By BNT Solutions, Inc.
Note: Site functionality is impaired when using IE6 or less.





