Re: [Vserver] Multiple gateways ... what is the best way with vserver ?

From: Luc Dumaine <ldumaine_at_sitiv.fr>
Date: Thu 11 May 2006 - 11:41:08 BST
Message-ID: <446314C4.2060809@sitiv.fr>

Sébastien CRAMATTE wrote:
>
> I've got a server configured with 2 vlans
> each vlan in a subred one vserver by vlan
>
> vlan100 10.2.0.2/16 -> gateway 10.2.0.1
>
> vlan200 192.168.1.2/24 -> gateway 192.168.1.1
>
> what is the best way to allow each vserver to reach internet (i need
> internet access on each vlan to use apt-get)

The linux kernel can support multiple routing tables, and you can use a
different routing table for packet with a given source address.

I would use commands like this:

/sbin/ip ru add from 10.2.0.2 table 5
/sbin/ip ro add 0.0.0.0/0 via 10.2.0.1 table 5

/sbin/ip ru add from 192.168.1.2 table 6
/sbin/ip ro add 0.0.0.0/0 via 192.168.1.1 table 6

The kernel must be compiled with CONFIG_IP_MULTIPLE_TABLES=Y
(IP: policy routing).
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Thu May 11 11:41:33 2006

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 11 May 2006 - 11:41:38 BST by hypermail 2.1.8