[Users] OpenVZ + VPS +dhclient

Kirill Korotaev dev at sw.ru
Sat Nov 19 04:35:19 EST 2005


Hello Eric,

you are the first who wants such configuration :), but I suppose it is 
possible to do it if better understand what you are doing and what are 
your goals.

Do you want your VPSs to be accessiable outside from the network?

1. If the answer is "no", then you can setup any local IPs to VPSs and 
configure NAT in the host system. Thus your VPSs will have local IPs, 
will be able to connect to the network, but won't be accessiable from 
outside (though you can map one specific port of the host system to VPS 
port, i.e. can make VPS http server to appear on some specific port of 
host system IP).

2. If the answer is "yes", then I suppose there is definetely something 
strange in your configuration, since DHCP can bring you arbitrary IP 
address and you will have to have some DNS tricks or otherwise you still 
won't be able to determine VPS IP easily  from the outside.
But the good news is that it is possible to do either :)
I have no dhclient on my machine, but dhcpcd I use here accepts -T 
option which allows (as follows from man page) to get multiple IPs 
without setuping them on the interface itself). So you will need to 
write some simple script which will reserve IP addresses from DHCP this 
way and configure them on VPS with `vzctl set <VPSID> --ipadd <IP>` 
command. Remember to delete previous VPS IP before adding a new one.

Hope this will work for you,
Kirill

> I have installed fedora core 4, followed up with the install of OpenVZ.  
> Everything seems to work well; however, I have a need to use dhcp rather 
> than static IP addresses.  Can I configure a VPS to use dhclient rather 
> than a static ip address?  If so how?  I tried to:
> 
> # vzctl enter ###
> # dhclient venet0
> 
> The guest was never able to contact the dhcp server.
> 
> My VPS is also fedora core 4.
> 
> Thanks!
> eanxgeek
> 
> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://openvz.org/mailman/listinfo/users
> 




More information about the Users mailing list