OpenVZ Forum


Home » General » Support » assign public ( or private ) ip to new vps?
assign public ( or private ) ip to new vps? [message #1597] Wed, 15 February 2006 02:37 Go to next message
snowdeal is currently offline  snowdeal
Messages: 22
Registered: February 2006
Junior Member
since i don't see any other posts regarding this topic, i'm going to have to assume that i'm missing something basic and this is yet another opportunity for me to embarrass myself in public.

anyway, i have a openvz installed on a hardware node running rhel3 with one nic and eth0 and lo enabled by default [1]. and for the life of me i can't figure out how to assign public ips from my pool of available addresses to a new vps.

of course, at first i tried following the quick install instructions precisely [2] and ran into a "Unable to apply network parameters: VPS is not running" error. so, naturally i'd start the vps and then apply the public ip. while the vps starts without a problem, i get an error that it's unable to add the route [3] because the network is down.

next, using my faulty logic skills i thought i'd turn on the addresses on the hardware node by properly configuring ifcfg-eth0-range0 and running './ifup-aliases eth0' to bring up the pool of addresses and assign one to the new vps. but after creating the node with a slightly modified set of commands [4], when i attempt to start the vps, i receive enough errors [5] to indicate that something has gone seriously awry.

lastly, i thought i might try assigning a private ip to the node and ssh into the running vps and assign the public ip, but i run into this problem [6] where my network is claming that they have every private/non-routable IP address for reasons that i don't understand.

if someone could help get me out of this quagmire, i'd be mighty obliged.


eric

[1]
eth0 Link encap:Ethernet HWaddr my.mac.address
inet addr:my.public.ip Bcast:my.bcast Mask:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:262511 errors:0 dropped:0 overruns:0 frame:0
TX packets:237674 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:226756755 (216.2 Mb) TX bytes:38988863 (37.1 Mb)
Base address:0xecc0 Memory:fe100000-fe120000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8493 errors:0 dropped:0 overruns:0 frame:0
TX packets:8493 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:799010 (780.2 Kb) TX bytes:799010 (780.2 Kb)

[2]
vzctl create 101 --ostemplate centos-4-i386-default --config vps.basic
/usr/sbin/vzctl set 101 --ipadd next.public.ip
Unable to apply network parameters: VPS is not running
WARNING: Settings were not saved and will be resetted to original values on next start (use --save flag)

[3]
/usr/sbin/vzctl set 101 --ipadd next.public.ip
Adding IP address(es): next.public.ip
RTNETLINK answers: Network is down
vps-net_add ERROR: Unable to add route /sbin/ip route add next.public.ip dev venet0 src my.public.ip

[4]
vzctl create 101 --ostemplate centos-4-i386-default --config vps.basic
vzctl set 101 --onboot yes --save
vzctl set 101 --ipadd next.public.ip --save

[5]
Starting VPS ...
VPS is mounted
Adding IP address(es): next.public.ip
RTNETLINK answers: Network is down
vps-net_add ERROR: Unable to add route /sbin/ip route add public.ip.195 dev venet0 src public.ip.215
VPS start failed
Stopping VPS ...
VPS was stopped
vzquota : (error) Quota off syscall for id 101: Device or resource busy
vzquota setlimit -f failed [3]
VPS is unmounted

[6]
http://forum.openvz.org/index.php?t=msg&th=207&#msg_ 951

[Updated on: Wed, 15 February 2006 02:38]

Report message to a moderator

Re: assign public ( or private ) ip to new vps? [message #1600 is a reply to message #1597] Wed, 15 February 2006 09:06 Go to previous messageGo to next message
dim is currently offline  dim
Messages: 344
Registered: August 2005
Senior Member
1) If you assign some address to new VPS, it should be unused by node address. So, it shouldn't be assigned as eth0 alias.
2) Possibly the reason of errors [2] and [5] is that venet0 interface is down.


http://static.openvz.org/openvz_userbar_en.gif
Re: assign public ( or private ) ip to new vps? [message #1602 is a reply to message #1600] Wed, 15 February 2006 13:31 Go to previous messageGo to next message
snowdeal is currently offline  snowdeal
Messages: 22
Registered: February 2006
Junior Member
dim wrote on Wed, 15 February 2006 04:06

2) Possibly the reason of errors [2] and [5] is that venet0 interface is down.


when i start openvz it looks like it's brought up. or at least openvz thinks it is:

# /etc/init.d/vz start
Starting OpenVZ: [ OK ]
Bringing up interface venet0: [ OK ]
Configuring interface venet0: net.ipv4.conf.venet0.send_redirects = 0

but it's not listed with ifconfig, which i presume means that it is, in fact, down?

i don't see anything informative in vzctl.log or the openvz users guide regarding this issue.

how can i determine why openvz thinks that it has brought up venet0 when it really hasn't?

Re: assign public ( or private ) ip to new vps? [message #1603 is a reply to message #1602] Wed, 15 February 2006 13:56 Go to previous messageGo to next message
dim is currently offline  dim
Messages: 344
Registered: August 2005
Senior Member
Check:
1) ifconfig -a
2) lsmod | grep vznet
3) dmesg

If vznetdev module is not loaded, try:
modprobe vznetdev
ifconfig venet0 up


http://static.openvz.org/openvz_userbar_en.gif
Re: assign public ( or private ) ip to new vps? [message #1604 is a reply to message #1603] Wed, 15 February 2006 14:48 Go to previous messageGo to next message
snowdeal is currently offline  snowdeal
Messages: 22
Registered: February 2006
Junior Member
strange. i decided to do a server reboot and now venet0 is up [1] . but still can't add the public ip [2].

results from lsmod [3]. i could attach the results from dmesg, but i don't see anything related to openvz.


[1]
venet0 Link encap:UNSPEC HWaddr 00-00-FF-00-00-00-00-00-00-00-00-00-00-00-00-00
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

[2]
#/usr/sbin/vzctl set 101 --ipadd my.new.ip
Unable to apply network parameters: VPS is not running

[3]
#/sbin/lsmod | grep vznet
vznetdev 13216 1
vzmon 44484 1 vznetdev
vzdev 2176 3 vzdquota,vznetdev,vzmon

[Updated on: Wed, 15 February 2006 14:49]

Report message to a moderator

Re: assign public ( or private ) ip to new vps? [message #1606 is a reply to message #1604] Wed, 15 February 2006 15:09 Go to previous messageGo to next message
dim is currently offline  dim
Messages: 344
Registered: August 2005
Senior Member
use vzctl set VPSID --ipadd new.ip --save


http://static.openvz.org/openvz_userbar_en.gif
Re: assign public ( or private ) ip to new vps? [message #1608 is a reply to message #1606] Wed, 15 February 2006 15:35 Go to previous messageGo to next message
snowdeal is currently offline  snowdeal
Messages: 22
Registered: February 2006
Junior Member
it works! thanks.

so you have to use --save with a public ip, but not a private?

regardless, i'm happy that it's working. thanks again, for the help.
Re: assign public ( or private ) ip to new vps? [message #1610 is a reply to message #1608] Wed, 15 February 2006 15:48 Go to previous messageGo to next message
dim is currently offline  dim
Messages: 344
Registered: August 2005
Senior Member
If you use `vzctl set ` command without --save, it works only on running VPSs. That's why you have error that VPS is not running. '--save' option says vzctl to save changes in VPS config. And this should be the same for private IPs.

http://static.openvz.org/openvz_userbar_en.gif
Re: assign public ( or private ) ip to new vps? [message #1611 is a reply to message #1610] Wed, 15 February 2006 16:28 Go to previous messageGo to next message
snowdeal is currently offline  snowdeal
Messages: 22
Registered: February 2006
Junior Member
dim wrote on Wed, 15 February 2006 10:48

If you use `vzctl set ` command without --save, it works only on running VPSs.


ah. i guess part of my confusion ( although there were other confounding issues ) came from the quick start guide [1] that says to add the ip without --save before you start the vps.

[1] http://openvz.org/documentation/guides/installation/vps-crea tion
Re: assign public ( or private ) ip to new vps? [message #1612 is a reply to message #1611] Wed, 15 February 2006 16:51 Go to previous message
dim is currently offline  dim
Messages: 344
Registered: August 2005
Senior Member
Thanks for your report!
Fixed.


http://static.openvz.org/openvz_userbar_en.gif
Previous Topic: support for 3Ware \ 2 channel SATA RAID controller?
Next Topic: Problem with running apache2
Goto Forum:
  


Current Time: Sun Jul 21 04:26:40 GMT 2024

Total time taken to generate the page: 0.02339 seconds