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
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.
Please attach the content of your /etc/conf.d/net
Created attachment 30044 [details] My /etc/conf.d/net before moving the routes to /etc/conf.d/local.start
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.