default router at boot time

I'm using Slackware ver. 2.0.0 and I
want to declare a default router at
boot time, I know how to do it by using
the route command.

I tried to do this by declaring in
/etc a file called defaultrouter with
the ip address in it but it didntĀ“t work

any idea.

Thanks in advance...
Who is Participating?
sane101999Connect With a Mentor Commented:
Assuming that Slackware uses the same "initscripts" code as RedHat (v4.00 on my system), you can configure a default router, along with any other static routes you need, in /etc/sysconfig/static-routes.  Here is a sample line from this file on one of my systems:

eth0 net netmask gw

The script (/etc/sysconfig/network-scripts/ifup-routes) which consumes this file simply compares the name of the interface that is being brought up against the first field (eth0), and if it matches, runs:

/sbin/route add -<rest of line> <interface>

Using the "static routes" tab on the netcfg GUI simply manipulates this file.

Hope this helps.

- Michael K. Edwards, LLC
cblazqueAuthor Commented:
to sane:

There is no /etc/sysconfig under Slackware.

any other idea?????
Could you post the output of ls /etc/rc.d, please?  If Slackware doesn't use the initscripts package, I'd like to see what it does for a boot procedure.  Thanks.
cblazqueAuthor Commented:
to sane:
here is the ls -l in /etc/rc.d
lrwxrwxrwx   1 root     root            4 Sep  7 07:55 rc.0 -> rc.6*
-rwxr-xr-x   1 root     root          396 Oct  2  1995 rc.4*
-rwxr-xr-x   1 root     root         2273 May 19  1996 rc.6*
-rwxr-xr-x   1 root     root         1158 May 19  1996 rc.K*
-rwxr-xr-x   1 root     root         3140 Jun 23  1996 rc.M*
-rwxr-xr-x   1 root     root         4262 Sep 14 11:46 rc.S*
-rwxr-xr-x   1 root     root         1175 Jul  6  1996 rc.cdrom*
-rwxr-xr-x   1 root     root         1977 Sep  7 09:30 rc.inet1*
-rwxr-xr-x   1 root     root         2941 Oct 28 09:50 rc.inet2*
-rwxr-xr-x   1 root     root         2888 Oct 28 09:44 rc.inet2%*
-rwxr-xr-x   1 root     root           37 Sep  7 08:38 rc.keymap*
-rwxr-xr-x   1 root     root          113 Oct  2  1995 rc.local*
-rwxr-xr-x   1 root     root         5241 Jun 25  1996 rc.modules*
-rwxr-xr-x   1 root     root         8121 Apr 30  1995 rc.serial*
-rw-r--r--   1 root     root        14877 Oct 27 11:13

I resolved the problem by adding the proper lines
of the route command in the rc.inet2 file, but if  you
have another idea is ok.

Sure enough, that's a set of BSD-style rc scripts.  The rc.M file ("go to multi-user state") probably invokes a number of the other scripts, including rc.inet2, which is no doubt the correct place for your "/sbin/route add ..." command.  Sorry I assumed incorrectly that Slackware would use SysV-style init scripts.  I mostly use RedHat because it's what my clients have heard of.  Thanks for following up with a good solution; now I know.

- Michael
All Courses

From novice to tech pro — start learning today.