[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Static routes for eth0 at startup



On Mon, 2004-07-12 at 14:24, Ben Adams wrote:
> I have a server that uses the system default gateway for the vast
> majority of its traffic, but needs a different gateway for a handful of
> specific hosts. I want to establish specific routes for these hosts,
> which I would normally do from the command line like so:
> 
>     route add -host A.B.C.D gw X.X.X.X
>     route add -host E.F.G.H gw X.X.X.X
>     . . . etc . . .
> 
> I could just tack these commands onto the end of rc.local (or some other
> such hack), but I know there's got to be something more elegant.
> 
> What's the proper place to list these routes so that they will be
> applied to eth0 at boot?

/etc/sysconfig/network-scripts/routes-eth0

ADDRESS0=192.168.0.0
NETMASK0=255.255.255.0
GATEWAY0=10.10.10.1
ADDRESS1=...
NETMASK1=...
GATEWAY1=...

It's not well documented, but you will see this if you read
/etc/sysconfig/network-scripts/ifup-routes

-- 
Chris Kloiber, RHCT
Global Support Services
Red Hat, Inc.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]