Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]additional routes at boot time using /etc/conf.d/net
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
lunarg
Guru
Guru


Joined: 07 Jan 2004
Posts: 508
Location: Peer, Belgium

PostPosted: Fri May 12, 2006 11:29 am    Post subject: [SOLVED]additional routes at boot time using /etc/conf.d/net Reply with quote

Hi,

Our recent changes to our corporate network has required me to add an additional eth alias with an extra IP address. This all works fine using /etc/conf.d/net as follows:
Code:
config_eth0=(
        "<primary ip>/24"
        "<secondary ip>/24"
)

routes_eth0=(
        "default via <primary gw>"
)

config_eth1=(
        "null"
)

#routes_eth1=("")

The problem now is that I need to specify a route for a subnet that needs to be routed to the gateway of the secondary network. This is very easy with the proper "ip route add" command, but I would like to do this at boot time, and preferably using /etc/conf.d/net. Looking at how the default gateway is added, I attempted this (IP is masked because of security reasons):
Code:
routes_eth0=(
        "<net to be routed>/23 via <secondary gateway>"
)

Unfortunately, this doesn't seem to work: while the net.eth0 starts up, a [!!] shows me that the route is not added as it should.

Anyone has any thoughts? Or am I simply missing something?

Thanks

Kind regards
_________________
Registered linux user #341804
Visit Black Manticore: http://www.blackmanticore.com/


Last edited by lunarg on Fri May 12, 2006 4:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri May 12, 2006 11:43 am    Post subject: Reply with quote

I'm guessing that you're using baselayout-1.11 and I'm pretty sure it's fixed in 1.12
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
lunarg
Guru
Guru


Joined: 07 Jan 2004
Posts: 508
Location: Peer, Belgium

PostPosted: Fri May 12, 2006 3:22 pm    Post subject: Reply with quote

UberLord wrote:
I'm guessing that you're using baselayout-1.11 and I'm pretty sure it's fixed in 1.12

That could explain it. But it seems that baselayout 1.12 isn't in stable yet.

Guess I'll have to wait until then, and add it to local.start just for now.

Thanks for the help.

Kind regards.
_________________
Registered linux user #341804
Visit Black Manticore: http://www.blackmanticore.com/
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54793
Location: 56N 3W

PostPosted: Fri May 12, 2006 3:29 pm    Post subject: Reply with quote

lunarg,

The following works for me:-
Code:
routes_eth0=(
       "default via 192.168.100.1"
       "-net 192.168.0.0/24 via 192.168.100.6"
)
notice its -net, not just net as you have in your net file.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
lunarg
Guru
Guru


Joined: 07 Jan 2004
Posts: 508
Location: Peer, Belgium

PostPosted: Fri May 12, 2006 4:55 pm    Post subject: Reply with quote

Thanks NeddySeagoon, :D

This works very well.

Kind regards.
_________________
Registered linux user #341804
Visit Black Manticore: http://www.blackmanticore.com/
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