I have a laptop and use both a nic (/etc/init.d/net.eth0) and a wireless pcmcia card (/etc/init.d/net.eth1). Everytime I decide to unplug my nic cable and run around the house using the wireless pcmcia card, I usually have to edit the /etc/conf.d/net and change the $gateway variable to show gateway="eth1/192.168.2.1" instead of the usual gateway="eth0/192.168.2.1. Of course, specifying eth1 to use dhcp would rectify this issue, but I want to keep things statically assigned for personal reasons. Could /etc/init.d/net* be modified to read an optional syntax for the $gateway variable such as gateway="eth0,eth1/192.168.2.1"? I've searched quite a bit for a solution for this issue and have yet to find anything except something called "netplug" Reproducible: Always Steps to Reproduce: 1. 2. 3. Expected Results: /etc/init.d/net* to read in the users preferred $gateway variable for which ever nic device the user wants to use.
or extend the gateway var to behave like others ... gateway_eth0="..."
Or use the new syntax, which is documented in /etc/conf.d/net.example routes_eth0=( "default via 192.168.0.1" ) routes_eth1=( "default via 192.168.0.1" ) Of course, if both were active then you would get errors, so you have 2 choices 1) use metrics routes_eth0=( "default via 192.168.0.1 metric 0" ) routes_eth1=( "default via 192.168.0.1 metric 2" ) 2) use baselayout-1.12.0 and set RC_AUTO_INTERACE="yes" in /etc/conf.d/rc so we handle metrics for you
Edited /etc/conf.d/net to show: routes_eth0=( "default via 192.168.2.1" ) routes_eth1=( "default via 192.168.2.1" ) I now get this output on restarting net.eth1: # /etc/init.d/net.eth1 restart * Caching service dependencies ... [ ok ] * Bringing eth1 down ... [ ok ] * Bringing eth1 up (192.168.2.4) ... [ ok ] * Adding routes * default via 192.168.2.1 ... Usage: inet_route [-vF] del {-host|-net} Target[/prefix] [gw Gw] [metric M] [[dev] If] inet_route [-vF] add {-host|-net} Target[/prefix] [gw Gw] [metric M] [netmask N] [mss Mss] [window W] [irtt I] [mod] [dyn] [reinstate] [[dev] If] inet_route [-vF] add {-host|-net} Target[/prefix] [metric M] reject inet_route [-FC] flush NOT supported But, hey.. .it works. The error seems to be caused by my orinoco pcmcia wireless nic card. So I augmented /etc/conf.d/net to show: gateway="eth1/192.168.2.1" routes_eth0=( "default via 192.168.2.1" ) #routes_eth1=( "default via 192.168.2.1" ) As you can see, I reverted to using the old "gateway=" syntax for the wireless net.eth1 device and using the new "routes_eth0" syntax for the standard nic interface. Things seem to be working without errors now.
(btw, submitted two bugs today and have experienced exceptional friendly customer service with excellent feedback!) btw, I'm seeing this within the handbook-x86.xml?part=1&chap=8 now too. I either missed it or the feature was just documented within the past month or so. :-) Great work. Thankyou!