-
Notifications
You must be signed in to change notification settings - Fork 181
Static IP #296
Comments
The plugin should write to the config file before bringing up the container for the first time. Unfortunately I dunno what might be causing that. I'll try to give it a go when I have a chance but if you have new information to share please let us know! |
The config is written before starting up. The machine is also starting with the good IP. I'm trying to find out why for no apparent reason the machine is changing IP. |
@PierrePaul would you be able to try to reproduce this with plain old lxc without vagrant-lxc just to make sure this is something related to the plugin and not with lxc itself? if you need help with that please lmk |
Plain lxc works, with the same rootfs and a copied config. IP is not overwritten. |
I just noticed I havent put my Vagrantfile Config :
Also, while debugging, I found out that Dnsmasq actually gives it an IP. Even though one is already set here. |
For those finding this thread via the search or Google, this is no longer enough to have a static IP for vagrant-lxc :
Getting a static IP is part of the big task #298
Under ubuntu 14.04 with the default settings, the link should be called lxcbr0 giving the following config :
|
Another thing, in my case my base box (from the official repo https://github.com/fgrehm/vagrant-lxc-base-boxes ) was using eth0 on dhcp. vagrant-lxc was setting the IP on eth0 (instead of creating a new virtual interface), then the dhcp would kick in and re-assign a new IP over the eth0. Moving the basebox eth0 to eth1 made it all work for me. |
Thanks for the info. It's sad to know that I'll try to get to implement a proper support for private networks this month. |
Im using the 1.0.0.alpha.2, under Ubuntu 14.04 as the Host.
I'm trying to spawn guest running ubuntu 14.04 (trusty).
My LXC version:
Architecture: amd64
Version: 1.0.3-0ubuntu3
I'm trying to bind a static IP on the container using :
lxc.customize 'network.ipv4', 10.0.3.102
The IP is withing the DHCP range of my dnsmasq.
The container starts with a DHCP IP (10.0.3.180, or any IP under 10.0.3.*).
If I do a vagrant reload though, it resets the IP correctly to 10.0.3.102.
I have not found a good way to redirect the output correctly to a log file, so here is the revelant part(at least I think it is revelant) of the vagrant up --provider=lxc :
In the LXC config file for the container I have the correct IP (10.0.3.102) and I am suspecting that reload will force a read on the config file and put the right IP, while a vagrant up might try to do some unwanted magic after booting the container with a valid IP.
Any ideas what I should look at?
The text was updated successfully, but these errors were encountered: