OpenVZ Forum


Home » General » Support » Change main ip for vps
Change main ip for vps [message #32390] Tue, 05 August 2008 06:15 Go to next message
gozargah is currently offline  gozargah
Messages: 32
Registered: June 2008
Member
Hi,

How can change main ip address for a vps?

Thanks
Re: Change main ip for vps [message #32392 is a reply to message #32390] Tue, 05 August 2008 07:27 Go to previous messageGo to next message
harrison is currently offline  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
Re: Change main ip for vps [message #32394 is a reply to message #32392] Tue, 05 August 2008 08:38 Go to previous messageGo to next message
gozargah is currently offline  gozargah
Messages: 32
Registered: June 2008
Member
Hi,

No, its not useful for virtual private server.
Re: Change main ip for vps [message #32400 is a reply to message #32390] Tue, 05 August 2008 15:02 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hi,

1. What do you use: venet or veth?
- if venet: why don't you use "vzctl set VE_ID --ipadd/--ipdel IP"
- if veth: "ifconfig" or "ip" utility inside VE.
2. What does it mean "main ip address"?
Re: Change main ip for vps [message #45185 is a reply to message #32392] Wed, 08 February 2012 02:36 Go to previous message
lha2 is currently offline  lha2
Messages: 1
Registered: February 2012
Junior Member
Hello,

i'm brazilian and i'm the same problem... in the veportal panel how to change main ip address, because i can't see a option to change ip and i try many times by ssh but no sucess...

anybody can help me?
Previous Topic: Kernel Panic with latest CentOS 6 kernel
Next Topic: Kernel panic production server(s) on HP DL180 G6
Goto Forum:
  


Current Time: Mon Nov 04 07:15:07 GMT 2024

Total time taken to generate the page: 0.03507 seconds