[lxc-users] container on the same network than other devices

Carmelo Ingrao carmelo at ingrao.fr
Mon Apr 1 11:16:52 UTC 2019


Hello,

Thanks Anton and Andrey !

I've done it, using macvlan bridge :

# lxc profile copy default lanprofile
# lxc profile device set lanprofile eth0 nictype macvlan
# lxc profile device set lanprofile eth0 parent ens160
# lxc profile copy default lanprofile

# lxc profile show lanprofile
config: {}
description: Default LXD profile
devices:
  eth0:
    name: eth0
    nictype: macvlan
    parent: ens160
    type: nic
  root:
    path: /
    pool: default
    type: disk
name: lanprofile
used_by:
- /1.0/containers/www1
- /1.0/containers/monitoring
- /1.0/containers/rp1
- /1.0/containers/blog



# lxc launch -p lanprofile ubuntu:18.04 monitoring


AND .... BOOM IT'S AMAZING :p


carmelo at infratest2:~$ lxc list
+------------+---------+----------------------+------+------------+-----------+
|    NAME    |  STATE  |         IPV4         | IPV6 |    TYPE    |
SNAPSHOTS |
+------------+---------+----------------------+------+------------+-----------+
| blog       | RUNNING | 192.168.0.253 (eth0) |      | PERSISTENT |
0         |
+------------+---------+----------------------+------+------------+-----------+
| monitoring | RUNNING | 192.168.0.240 (eth0) |      | PERSISTENT |
0         |
+------------+---------+----------------------+------+------------+-----------+
| rp1        | RUNNING | 192.168.0.249 (eth0) |      | PERSISTENT |
0         |
+------------+---------+----------------------+------+------------+-----------+
| www1       | RUNNING | 192.168.0.241 (eth0) |      | PERSISTENT |
0         |
+------------+---------+----------------------+------+------------+-----------+


Thanks both of you for pointing out the solution :)

Have a great day !


Le dim. 31 mars 2019 à 11:35, Andrey Repin <anrdaemon at yandex.ru> a écrit :

> Greetings, Carmelo Ingrao!
>
> > I'm new to this mailing list. I'm using LXD since a few months, but until
> > now, my conainters were bridged in their own network.
>
>
> > Now, I want the containers can obtain IP adresses on the same subnet than
> > the LXD manager, and other devices in my home network.
>
>
> > So :
>
>
> > Home router : 192.168.0.219
> > Desktop computer : 192.168.0.100
> > Domotic solution : 192.168.0.200
> > LXD "manager" : 192.168.0.232
>
>
> > I want the containers with IP like 192.168.0.240-250, and be able to be
> seen and see the orher devices.
>
> You can use macvlan bridge network on LAN interface instead of the default
> dedicated bridge.
>
>
> --
> With best regards,
> Andrey Repin
> Sunday, March 31, 2019 12:23:01
>
> Sorry for my terrible english...
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>


-- 

Carmelo Ingrao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20190401/4ce65434/attachment.html>


More information about the lxc-users mailing list