Re: Change main ip for vps [message #32392 is a reply to message #32390] |
Tue, 05 August 2008 07:27 ![Go to previous message Go to previous message](/theme/ovz3/images/up.png) ![Go to next message Go to previous message](/theme/ovz3/images/down.png) |
harrison
Messages: 4 Registered: July 2008 Location: Ca
|
Junior Member |
|
|
Hi,
I hope this may help you. i am not sure whether it is correct or not
Add Ip address CentOS/RedHat/Fedora Linux
------------------------------------------------------------ ------------------------------------------------------------ ----------------
CentOS/RedHat/Fedora Linux:
------------------------------------------------------------ ------------------------------------------------------------ ----------------
To add IPs in LINUX you need to create a new file per each IP in
# cd /etc/sysconfig/network-scripts/
directory. You will find in this directory file with a name ifcfg-eth0 or very similar.
# ls ifcfg-*
------------------------------------------------------------ ------------------------------------------------------------ ------
Open it in editor, you will easily recognize the first IP of your computer and figure out file format.
Now copy this file:
# cp ifcfg-eth0 ifcfg-eth0:0
Now edit your new file: (Pico is for wussies!)
# vi ifcfg-eth0:0
you need to change the DEVICE & the original IP to a second IP.
Next, edit icfg-eth0:0 and change the DEVICE line to be:
DEVICE=eth0:0
& change the IPADDR line to the new IP:
IPADDR=70.**.**.***
Finally if you want it to start up with the cimputer just make sure ONBOOT is set to yes.
ONBOOT=yes
Once finished - Save the edited file.
------------------------------------------------------------ ------------------------------------------------------------ ------
To add a third IP:
# cp ifcfg-eth0 ifcfg-eth0:1
Again edit it to change the first IP to a third IP. Now you have three similar files in directory /etc/sysconfig/network-scripts/ :
ifcfg-eth0
ifcfg-eth0:0
ifcfg-eth0:1
Please notice filename format: IT IS MANDATORY! Each of these files will provide IP information for a network initializing script.
------------------------------------------------------------ ------------------------------------------------------------ ------
To activate new IPs you can reboot the computer.
Restart the network config activate new IPs by running one of the following scripts below:
Option 1: (Start each ip individually)
# ./ifup eth0:0
Option2: (Restart the entire network)
# /etc/rc.d/init.d/network -reload
With regards,
Harrison
With regards,
Harrison
|
|
|