From: Herbert Poetzl (herbert_at_13thfloor.at)
Date: Wed 26 Nov 2003 - 22:21:19 GMT
On Wed, Nov 26, 2003 at 10:05:48PM +0100, Markus Olsson wrote:
> Hello there.
>
> I've been googling a lot and I have found some possible solutions to my
> problem but none have provided me with enough info to really do it.
> Therefore I'm turning to this mailing list for help.
>
> Here's my problem. I'm currently employed at an education where we have
> about 50 clients and 1 server. I'd like to set up a couple of vservers
> on this server so that the students can use them for whatever purpose
> they want.
>
> So far so good but here comes the tricky part. The server is also the
> gateway and it has 2 network devices (eth0 and eth1) where eth0 is:
> inet addr:192.168.47.254 Bcast:192.168.47.255 Mask:255.255.255.0
> and eth1 is:
> inet addr:192.168.0.254 Bcast:192.168.0.255 Mask:255.255.255.0
>
> Our ISP has provided us with an ip number (192.168.47.1) wich is to be
> used as the default gateway. This gateway does not allow any packages to
> pass unless they come from ip 192.168.47.254 (eth0.. yeah i know it's
> kinda backwards). This creates a problem when i set up the vserver
> "storm" with ip number 192.168.0.5. It uses the same default gateway
> as context 0 and that is a big problem.
>
> I've seen some solutions with iproute but I'm not able to figure out how
> they work. I'm wondering if it in any way could be possible to set the
> default gateway of "storm" to be 192.168.0.254 (eth1) and treat it as
> any other machine on the network (do address translation).
>
> Is it possible? And if yes, how do I accomplish that?
with the help of routing tables ...
ip route add <NET1> dev <DEV1> table <name1>
...
ip route add default via 192.168.0.254 dev eth1 table <name1>
ip rule add from <storm> table <name1>
should do the trick ...
I have posted an example for separated routing/
gateways on the list some time ago, you should find
it in the archives ...
HTH,
Herbert
> Yours Cincerely
> --
> Markus Olsson
>
>
> _______________________________________________
> Vserver mailing list
> Vserver_at_list.linux-vserver.org
> http://list.linux-vserver.org/mailman/listinfo/vserver
_______________________________________________
Vserver mailing list
Vserver_at_list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver