[lxc-users] nat networking with fixed (dhcp ) IP addresses

Michel Jansens michel.jansens at ulb.ac.be
Fri May 25 11:55:47 UTC 2018


> On 25 May 2018, at 12:25, Fajar A. Nugraha <list at fajar.net> wrote:
> 
> On Fri, May 25, 2018 at 3:25 PM, Michel Jansens
> <michel.jansens at ulb.ac.be> wrote:
>> Thanks Fajar it works!
>> 
>> What I did:
>> 
>> #lets create a new profile
>> lxc profile  copy default nonet
>> 
>> #remove network from the profile
>> lxc profile  device remove nonet eth0
>> 
>> #create the ’testip' container
>> lxc init ubuntu:18.04 testip --profile nonet
>> 
>> #attach the network device to it, with IP address
>> lxc config  device add testip eth0 nic nictype=bridged parent=lxdbr0
>> host_name=testip ipv4.address=10.0.3.203
> 
> 
> One note from me, you could actually use the default profile and
> override eth0 directly in the config file.
> At least it works with "lxc config edit", didn't try with "lxc config device”.

With lxc config device add, it looks like it does strange things: in  "lxc network  list-leases lxdbr0” I get 2 entries for the container, with the same Mac address and different IPs (one STATIC and ON DYNAMIC) and the twrong one is listed in lxc list…

Michel


> 
> -- 
> Fajar
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20180525/a8387ca2/attachment.html>


More information about the lxc-users mailing list