Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Odd conf.d/net route problem - dev eth0 changes to eth1
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
Arathrael
n00b
n00b


Joined: 19 Jun 2004
Posts: 3

PostPosted: Tue Jun 19, 2007 1:09 pm    Post subject: Odd conf.d/net route problem - dev eth0 changes to eth1 Reply with quote

The problem is that a route specified for the eth1 interface in /etc/conf.d/net isn't being added correctly - 'dev eth0' is being replaced by 'dev eth1'. Here's the detail:

I have a gentoo server with two network cards, eth0 and eth1.

I want a separate routing table for eth1, with its own default gateway. So I have a table, added to /etc/iproute2/rt_tables, called eth1.

This server should pass traffic coming in on eth1 on to 192.168.99.11 also on the eth1 network, unless it's going to 10.9.200.143 on the eth0 network. So the eth1 routing table should then look something like this:

Code:
10.9.200.143 dev eth0 scope link
default via 192.168.99.11 dev eth1 metric 1


And this works as desired if I add the rules manually. But if I specify the rules in /etc/conf.d/net, like this:

Code:

config_eth1=(
    "192.168.254.1/16"
)
routes_eth1=(
    "default via 192.168.99.11 dev eth1 table eth1"
    "10.9.200.143/32 dev eth0 table eth1"
)


What I get when I '/etc/init.d/net.eth1 start':
Code:

* Starting eth1
*  Bringing up eth1
*    192.168.254.1/16                                                 [ok]
*  Adding routes
*    default via 192.168.99.11 dev eth1 table eth1 ...                [ok]
*    10.9.200.143/32 dev eth0 table eth1 ...                          [ok]


is this:
Code:

# ip route show table eth1
10.9.200.143 dev eth1 scope link metric 1
default va 192.168.99.11 dev eth1 metric 1


It changes the 'dev eth0' specified for the 10.9.200.143 route in /etc/conf.d/net to 'dev eth1'. Which doesn't work, because 10.9.200.143 isn't on eth1, it's on eth0!

If I then manually delete the route and re-add it ('ip route add 10.9.200.143 dev eth0 table eth1'), it's as it should be, dev eth0, and works.

I can work around it with a postup function I guess, or put the routes in some other way, but I'd prefer to have the routes needed for the interface specified along with the interface.

So if anyone's got any idea why that's happening and how to stop it, I'd really appreciate it.
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