Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 110325 - Possible to define multiple $gateway within /etc/conf.d/net?
Summary: Possible to define multiple $gateway within /etc/conf.d/net?
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-24 07:37 UTC by Roger
Modified: 2005-10-24 18:28 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!