[Lxc-users] appropriate architecture for two sets of containers on one host

Fajar A. Nugraha list at fajar.net
Thu Mar 14 03:48:36 UTC 2013


On Thu, Mar 14, 2013 at 2:04 PM, Mike <sourceforge at good-with-numbers.com>wrote:

> ---------------------------------------------
> iface eth1.18 inet manual
>
> auto br1.18
> iface br1.18 inet static
>


>         gateway 192.168.18.1
>


> iface eth1.17 inet manual
>
> auto br1.17
> iface br1.17 inet static
>


>         gateway 192.168.17.1
>



>
> in /etc/network/interfaces, I got two default routes:
>
> ---------------------------------------------
> host$ ip route show
> 192.168.18.0/24 dev br1.18  proto kernel  scope link  src 192.168.18.2
> 192.168.17.0/24 dev br1.17  proto kernel  scope link  src 192.168.17.2
> default via 192.168.17.1 dev br1.17
> default via 192.168.18.1 dev br1.18
> ---------------------------------------------
>
> I'm curious how you configured yours.
>
>
You only need to have one gateway.

Think of it this way. Are you familiar with L2 switches (e.g. the
old-reliable Cisco 2950-series)? If yes, then configure the host like that.
While the switch will have many vlans, usually only one vlan (i.e. the
management vlan) will have an IP addrress, and it will only have one
gateway as well.  Other interfaces doesn't have IP addresses on the switch
side.

So on your setup, you can use something like this to create a bridge
without IP address for a vlan:

iface eth1.17 inet static
        address 0.0.0.0
        netmask 0.0.0.0

auto br1.17
iface br1.17 inet manual
        bridge_ports eth1.17
        bridge_maxwait 0
        bridge_fd 0
        bridge_stp off

-- 
Fajar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20130314/8c0275f9/attachment.html>


More information about the lxc-users mailing list