View previous topic :: View next topic |
Author |
Message |
lunarg Guru
Joined: 07 Jan 2004 Posts: 508 Location: Peer, Belgium
|
Posted: Fri May 12, 2006 11:29 am Post subject: [SOLVED]additional routes at boot time using /etc/conf.d/net |
|
|
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 |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
lunarg Guru
Joined: 07 Jan 2004 Posts: 508 Location: Peer, Belgium
|
Posted: Fri May 12, 2006 3:22 pm Post subject: |
|
|
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 |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54793 Location: 56N 3W
|
Posted: Fri May 12, 2006 3:29 pm Post subject: |
|
|
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 |
|
|
lunarg Guru
Joined: 07 Jan 2004 Posts: 508 Location: Peer, Belgium
|
Posted: Fri May 12, 2006 4:55 pm Post subject: |
|
|
Thanks NeddySeagoon,
This works very well.
Kind regards. _________________ Registered linux user #341804
Visit Black Manticore: http://www.blackmanticore.com/ |
|
Back to top |
|
|
|