Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 110325

Summary: Possible to define multiple $gateway within /etc/conf.d/net?
Product: Gentoo Linux Reporter: Roger <rogerx.oss>
Component: [OLD] baselayoutAssignee: Roy Marples (RETIRED) <uberlord>
Status: RESOLVED INVALID    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Roger 2005-10-24 07:37:35 UTC
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.
Comment 1 SpanKY gentoo-dev 2005-10-24 08:09:46 UTC
or extend the gateway var to behave like others ...

gateway_eth0="..."
Comment 2 Roy Marples (RETIRED) gentoo-dev 2005-10-24 08:34:12 UTC
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
Comment 3 Roger 2005-10-24 17:01:35 UTC
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.
Comment 4 Roger 2005-10-24 18:28:54 UTC
(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!