Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to use both ipv6 externally on all my containers, and ipv4 external only on the hosts. I am using Ubuntu 12.04 64bit. For ipv4 on the container I use the DHCP that came with the lxc installation.

I got the setup working, but I'm not sure this is correct. Could you guys shed some light on it?

On my container host I use:

 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

In my container 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

And in my container(s) I use:

 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

And I get in the 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
  • Is this correct?
  • Is there a better way to bridge the ipv6 to the containers?

When I need to restart the network I get:

$ /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.
share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.