[lxc-users] Need help with static IP address -- Simplest use case.

gunnar.wagner gunnar.wagner at netcologne.de
Sat Jun 10 07:06:59 UTC 2017


On 6/10/2017 2:29 PM, Michael Johnson wrote:

 >> lxc config device add gentoo default nic nictype=bridged name=eth0 
parent=br0 ipv4.address=192.168.0.36/24 ipv6.address=none

where "gentoo" is the container's Alias and "default" the profile used 
for the "gentoo" container?

actually this would be super useful as a short wiki kind article/topic 
on discuss.linuxcontainers.org <https://discuss.linuxcontainers.org> I guess



On 6/10/2017 2:29 PM, Michael Johnson wrote:
> Here is the magic command:
>
> lxc config device add gentoo default nic nictype=bridged name=eth0
> parent=br0 ipv4.address=192.168.0.36/24 ipv6.address=none
>
> Issue that after configuring eth0 in the container to have the same
> static ip, and configuring a host bridge br0.
>
> No 'lxc network create' nor 'lxc network attach' is needed.
>
> I hope someone else finds this useful.
>
> -Mike
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
> ---
> This email has been checked for viruses by AVG.
> http://www.avg.com

-- 
Gunnar Wagner | Yongfeng Village Group 12 #5, Pujiang Town, Minhang 
District, 201112 Shanghai, P.R. CHINA
mob +86.159.0094.1702 | skype: professorgunrad | wechat: 15900941702
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170610/386fe23e/attachment.html>


More information about the lxc-users mailing list