[lxc-users] lxc bridge setup

Bostjan Skufca bostjan at a2o.si
Tue Mar 10 17:01:07 UTC 2015


Do you want your containers to use public IPs direcly, or do you want to
use local IPs and then forward whole traffic for certain IP towards
particular container?

In first case, just set lxc.network.link = br0 and configure public IP as
you have described it. Container uses the same GW as your host does.

In second case you need to create new bridge with internal network.
Containers need to use host as GW, and host must configure iptables to
forward traffic destined to IP X to container x, and masquerade outgoing
traffic from container x to IP X. Rinse and repeat for IP/container X/x+1.

b.


On 8 March 2015 at 19:52, Joe McDonald <ideafilter at gmail.com> wrote:

> I have 5 public IPs (/29) and would like to make them available to lxc
> containers.  I am on ubuntu 14.04.
>
> What is the procedure?   I tried to duplicate br0 with br1, etc and
> incrementing the IP#, but it didn't like it.  I'd like to make 1 IP
> for the host system, and the other 4 IP's each go to a container.
>
> I have this in /etc/network/interfaces:
>
> # The loopback network interface
> auto lo p4p1
> iface lo inet loopback
> iface p4p1 inet manual
>
>
> auto br0
> iface br0 inet static
>   bridge_ports p4p1
>   bridge_stp off
>   bridge_fd 0
>   bridge_maxwait 0
>
>   address 104.250.x.x
>   netmask 255.255.255.248
>   gateway 104.250.x.x
>   dns-nameservers 8.8.8.8
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150310/1ac2dca1/attachment.html>


More information about the lxc-users mailing list