On Mon, 2010-10-04, Dale Dellutri wrote:
> On Sun, 03 Oct 2010 23:05:23 +0200, jack <(E-Mail Removed)> wrote:
>> Rahul wrote:
>> > I had added a static route using:
>> >
>> > route add -net 172.16.0.0 netmask 255.255.0.0 dev eth3
>> >
>> > But each time I reboot this route seems to disappear. Google seems to point
>> > to a file "/etc/sysconfig/static_routes". But my CentOS / RHEL system
>> > doesn't seem to have this file. Is there an alternative location where
>> > static routes should be added to?
>> >
>
>> Seems about the right location, my CentOS5 boxen have something in
>> /etc/init.d/network that looks like
>
>> # Add non interface-specific static-routes.
>> if [ -f /etc/sysconfig/static-routes ]; then
>> grep "^any" /etc/sysconfig/static-routes | while read ignore
>> args ; do
>> /sbin/route add -$args
>> done
>> fi
>
>> In a default install the file doesn't exist, but if you create it (note
>> that it is static-routes, not static_routes), with contents
>
>> any -net 172.16.0.0 netmask 255.255.0.0 dev eth3
>
>> it should pick it up. It looks like (once) one could put per-interface
>> routes in there too, but I haven't seen any script that does that.
>
> Per-interface routes are put in
> /etc/sysconfig/network-scripts/route-eth<n>
> with <n> replaced by 0, 1, and so on.
>
> The format of the file is triplets such as:
> GATEWAY0=<lan gateway IP address>
> NETMASK0=255.255.255.0 <for example>
> ADDRESS0=<wan net IP address>
> and the next one uses GATEWAY1, NETMASK1, ADDRESS1 and so on.
There should also be official documentation somewhere which describes
this in detail. If not, I suggest switching to e.g. Debian which has
detailed man pages for things like these (see interfaces(5) for
example).
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
|