Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 48739 - /etc/init.d/net.eth0 will only parse one routes_eth0 from /etc/conf.d/net
Summary: /etc/init.d/net.eth0 will only parse one routes_eth0 from /etc/conf.d/net
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-22 16:18 UTC by Mitchell
Modified: 2004-05-06 20:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
My /etc/conf.d/net before moving the routes to /etc/conf.d/local.start (net,1.27 KB, application/octet-stream)
2004-04-25 16:18 UTC, Mitchell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mitchell 2004-04-22 16:18:49 UTC
I am setting up my computer to have multiple static routes.  I added multiple entries to the /etc/conf.d/net file with the routes_eth="" variable.  What happens is that the /etc/init.d/net.eth0 only parses the last entry in the routes_eth="".

Reproducible: Always
Steps to Reproduce:
1. /etc/init.d/net.eth0 restart
Actual Results:  
Added only one of the static routes

Expected Results:  
Added all of the static routes to the routing table
Comment 1 Mitchell 2004-04-25 13:55:38 UTC
I have established a workaround for this by adding the static routes to /etc/init.d/local.start with the "/sbin/route add" command.  This is not an elegant solution since I know have to manage two files instead of one and if the interface does not come up for whatever reason I am going to get errors at the local startup.
Comment 2 Aron Griffis (RETIRED) gentoo-dev 2004-04-25 16:06:35 UTC
Please attach the content of your /etc/conf.d/net
Comment 3 Mitchell 2004-04-25 16:18:09 UTC
Created attachment 30044 [details]
My /etc/conf.d/net before moving the routes to /etc/conf.d/local.start
Comment 4 Aron Griffis (RETIRED) gentoo-dev 2004-05-06 20:18:24 UTC
This is user error.  Sorry there wasn't a good example to guide you.  Here is what you should have:

routes_eth0=(
   "-net 1.0.0.0 netmask 255.0.0.0 dev eth0"
   "-net 2.0.0.0 netmask 255.0.0.0 dev eth0"
   "-net 3.0.0.0 netmask 255.0.0.0 dev eth0"
   "-net 180.1.1.254 netmask 255.255.255.0 dev eth0"
   "-net 180.2.2.254 netmask 255.255.255.0 dev eth0"
   "-net 180.3.3.254 netmask 255.255.255.0 dev eth0"
)

This will create a bash array called routes_eth0.  Right now in your file you're just reassigning a single variable over and over, so only the last assignment sticks.

Hope that helps.