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...
cblazqueAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sane101999Commented:
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 172.17.2.0 netmask 255.255.255.0 gw 172.17.1.30

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
  SANE.net, LLC
  (medwards@sane.net)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cblazqueAuthor Commented:
to sane:

There is no /etc/sysconfig under Slackware.

any other idea?????
0
sane101999Commented:
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.
0
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 rc.zip

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.

greetings...
0
sane101999Commented:
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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.