Rede com contêineres lxc com dhcp local e problemas de ponte dupla ipv6 externa

Rede com contêineres lxc com dhcp local e problemas de ponte dupla ipv6 externa

Quero usar o ipv6 externamente em todos os meus contêineres e o ipv4 externo apenas nos hosts. Estou usando o Ubuntu 12.04 64 bits. Para ipv4 no container eu uso o DHCP que acompanha a instalação do lxc.

Eu tenho a configuração funcionando, mas não tenho certeza se isso está correto. Vocês poderiam lançar alguma luz sobre isso?

No meu host de contêiner eu uso:

 auto lo
 iface lo inet loopback
    address 127.0.0.1
    netmask 255.0.0.0

 auto eth0
 iface eth0 inet manual

 auto br-lxc
 iface br-lxc inet static
    address ipv4
    netmask 255.255.255.0
    gateway ipv4 gw
    bridge_ports eth0

 iface br-lxc inet6 static
    address exte:rnal::ipv6
    netmask 48
    gateway exte:rnal:ipv6:gw

Na configuração do meu contêiner:

 lxc.network.type= veth
 lxc.network.flags= up
 lxc.network.link= br-lxc
 lxc.network.hwaddr= random-mac
 lxc.network.name = eth0

 lxc.network.type=veth
 lxc.network.link=br-lxc-1 
 lxc.network.flags=up
 lxc.network.hwaddr= random-mac
 lxc.network.name = eth1

E no(s) meu(s) contêiner(es) eu uso:

 auto lo
 iface lo inet loopback

 auto eth0
 iface eth0 inet6 static
    address ipv6
    netmask 48
    gateway ipv6 gw

 auto eth1
 iface eth1 inet dhcp

E eu entro no container:

 $ip a|grep inet
    inet6 externalipv6:33/48 scope global
    inet6 internalipv6::78/64 scope link
    inet 10.0.3.52/24 brd 10.0.3.255 scope global eth1
    inet6 internalipv6::28/64 scope link
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
  • Isso está correto?
  • Existe uma maneira melhor de conectar o IPv6 aos contêineres?

Quando preciso reiniciar a rede, recebo:

$ /etc/init.d/networking restart

* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
* Reconfiguring network interfaces...   

Device "br-lxc" does not exist.

informação relacionada