Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How can I assign different gateways to subinterfaces?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
romandas
n00b
n00b


Joined: 20 Feb 2005
Posts: 66
Location: Germany

PostPosted: Wed Oct 31, 2007 11:18 am    Post subject: How can I assign different gateways to subinterfaces? Reply with quote

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
View user's profile Send private message
tobr
Guru
Guru


Joined: 29 May 2006
Posts: 330

PostPosted: Wed Oct 31, 2007 11:34 am    Post subject: Re: How can I assign different gateways to subinterfaces? Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum