View previous topic :: View next topic |
Author |
Message |
romandas n00b
Joined: 20 Feb 2005 Posts: 66 Location: Germany
|
Posted: Wed Oct 31, 2007 11:18 am Post subject: How can I assign different gateways to subinterfaces? |
|
|
I have two networks, each with its own gateway. I have assigned an ip from one network to eth0 (192.168.100.2/24) with the gateway of 192.168.100.1. I assigned an ip from the other network to eth0:0 (192.168.200.2/24) using:
config_eth0=(
"192.168.100.2 netmask 255.255.255.0 brd 192.168.100.255"
"192.168.200.2 netmask 255.255.255.0 brd 192.168.200.255")
routes_eth0("default via 192.168.100.1")
How can I ensure that any traffic meant for the 192.168.200.0/24 network uses 192.168.200.1 for a gateway? |
|
Back to top |
|
|
tobr Guru
Joined: 29 May 2006 Posts: 330
|
Posted: Wed Oct 31, 2007 11:34 am Post subject: Re: How can I assign different gateways to subinterfaces? |
|
|
romandas wrote: | How can I ensure that any traffic meant for the 192.168.200.0/24 network uses 192.168.200.1 for a gateway? |
Well, normally the network the interface is in is directly connected to that interface and you get a route like Code: | 192.168.200.0 * 255.255.255.0 U 0 0 0 eth0:0 | . That doesn’t have a gateway. If you don’t have the network 192.168.200.0/24 directly connected to eth0:0 then how should your computer find the IP 192.168.200.1? If it can find the IP via the gateway 192.168.100.1 then there is no need for a second gateway. Could you perhaps tell us what you want to archive and a rough outline of your network topology? That would really be helpful.
HTH _________________ Please add [SOLVED] to your message title if your problem is solved.
Death to all blobs! |
|
Back to top |
|
|
|