与本地dhcp和外部ipv6双桥问题的lxc容器联网

我想在所有容器上使用外部ipv6,而只在主机上使用外部ipv4。 我正在使用Ubuntu 12.04 64位。 对于容器上的ipv4,我使用lxc安装附带的DHCP。

我得到了设置工作,但我不知道这是正确的。 你们可以点亮一下吗?

在我的容器主机上,我使用:

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 

在我的容器configuration中:

  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 

在我使用的容器中:

  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 

我进入容器:

  $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 
  • 它是否正确?
  • 有没有更好的方法来桥接ipv6的容器?

当我需要重新启动networking时,我得到:

 $ /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.