Subject: Re: [vserver] Routing of vserver guests on multihomed hosts
From: "Daniel Hokka Zakrisson" <daniel@hozac.com>
Date: Sat, 13 Sep 2008 13:28:33 +0200 (CEST)

Oliver Welter wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi All,
>
> I am looking for help to setup my routing ;(
>
> Host:
> Homed in two different vlans
>
> vlan3@eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue
>     inet 82.135.58.9/25 brd 82.135.58.127 scope global vlan3
> vlan4@eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue
>     inet 212.18.24.209/26 brd 212.18.24.255 scope global vlan4
>
> Guest, having an interface only in vlan4
>
> I tried different routing setups:
> hosts default route via vlan4 -> works
>
> hosts default route via vlan3 -> I see in the guest:
> 0.0.0.0 82.135.58.1 0.0.0.0 UG 0 0 0 *
> As the guest does not know about vlan3, I cant ping to networks other
> than those connected to vlan4

The guest not knowing about vlan3 isn't related at all, most likely it's
your upstream router on vlan3 that doesn't route packets coming from
foreign source addresses (those belonging on vlan4).

> * default route via both vlan concurrently
> bad idea - route -n shows both routes inside the guest. No routing if
> the first rule is the wrong vlan (thats soemwhat obvious)

Only the first one will be used, unless you do round-robin using nexthop.

> * source based routing entries with iproute2
> removed the gerneal default route from the host, iproute2 settings are
> not imported to the guest - so no routing at all....

This is what you want. There's no such thing as "imported to guest", if
you set this up right, things will work.

> [...]

-- 
Daniel Hokka Zakrisson