[lxc-users] Q: Connecting a container to a static IP alias?

Michael Peek peek at nimbios.org
Thu Sep 29 14:59:53 UTC 2016


Thank you for your time!  But whatever I'm doing, it doesn't seem to be
working:

# lxc init images:ubuntu/xenial/amd64 my-ubuntu-1 \
--config lxc.network.type=macvlan \
--config lxc.network.link=enp0s10 \
--config lxc.network.ipv4=X.X.X.117
Creating my-ubuntu-1
error: Bad key: lxc.network.ipv4

# lxc init images:ubuntu/xenial/amd64 my-ubuntu-1
--config lxc.network.type=macvlan \
--config lxc.network.link=enp0s10
Creating my-ubuntu-1
error: Bad key: lxc.network.link

I've found sources online in several places that say lxc.network.link
and lxc.network.type are valid configuration keys.  The same sources
speak of editing files in /var/lib/lxc/ to change these configuration
settings too, but the installation of lxc (version 2.0.4) on my Ubuntu
host (version 16.04) doesn't have a /var/lib/lxc/ directory.

I'm sorry to keep pestering the list, but I'm pretty confused.

Michael

On 09/28/2016 05:16 PM, Andrey Repin wrote:
> Greetings, Michael Peek!
>
>> On 09/27/2016 12:01 PM, Andrey Repin wrote:
>>> Just remove alias from host and configure the address inside a VM. 
>> Thanks, that gets me one step closer.  The VM has the right address on
>> the inside.  But how do I get the *.117 address on the outside?
> There's no inside or outside. It either have it or not.
>
>> I tried creating the container with several variations of:
>> lxc init images:ubuntu/xenial/amd64 my-ubuntu-1 --config
>> lxc.network.type=[phys|maclan] --config lxc.network.link=enp0s10:testvm1
> Same mistake.
>
>> --config lxc.network.ipv4=X.X.X.117
>> Thanks for any help you can give!
> macvlan and ***enp0s10*** … Which is your real physical adapter.
>
>



More information about the lxc-users mailing list