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