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

Bug 540

Summary: Setting up Gateway routes on other network devices
Product: Gentoo Linux Reporter: Peter Foley <pjfoley>
Component: [OLD] UnspecifiedAssignee: Martin Schlemmer (RETIRED) <azarah>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: High    
Version: 1.0 RC6 r14   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Peter Foley 2002-02-05 04:56:45 UTC
Hello,

Hopefully the below will be usefull to allow you to add a feature to the system.

I am going to use my gentoo Distribution as a firewall.  What I wanted to do is
have the gateway on eth1.

In the default scripts to bring up the eth devices in "/etc/init.d/ethx" it does
not allow you to specify which device to add the route to (info taken from
"/etc/conf.d/net.ethx").

What I propose is that in the "/etc/conf.d/net.ethx" in the gateway section have
another variable "gatewaydev" where you set which device you would like to add
the route too.

eg

****
gatewaydev="eth1"
gateway="192.168.0.1"
****

Then in the "/etc/init.d/net.ethx" you change the route line to something like

"route add -net default gw $gateway netmask 0.0.0.0 metric 1 __ dev $gatewaydev __"

(Note Underline ( __ ) is my way of making the different part stand out).

Just thought that this would be usefull for anyone else who would like to add
routes on different devices.

Peter.
Comment 1 Daniel Robbins (RETIRED) gentoo-dev 2002-02-05 10:26:22 UTC
Maybe "gateway="eth1/192.168.0.1"" optional syntax?
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-02-05 17:23:25 UTC
Fixed on CVS, thanks.