APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed


This article is from a FAQ concerning SCO operating systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.

How do I add a default route? (SCO Unix)

route add default

would set the default route to, but that would not survive a reboot.

Prior to 5.0.6, there was no certain place to add this.

Beginning with 5.0.6, you can add the default route in /etc/default/tcp. Just modify the GATEWAY= line, and /etc/tcp will read that. DON'T DO THIS ON PRIOR RELEASES; /etc/tcp doesn't look for that until 5.0.6

Prior to 5.0.6, you have choices. You could add the commands to a start-up file (/etc/rc2.d/S99route, for example: it doesn't exist, but you can create it) or modify the /etc/gateways file (see 'man routed'for the syntax of that file). The disadvantage of /etc/gateways is that it is used by routed, so if you are not running routed, that won't work.

You could also modify /etc/tcp and add your routes after it sets up its default routes. That has the disadvantage of modifying a system file: an upgrade will overwrite that.

SCO OpenServer 5.0.4 adds a /etc/rc2.d/S90iproute script that reads /usr/internet/etc/sco_ip/routes. It's the Internet Manager that can add info to that file, but there's no reason you can't do it manually. The format is simple:

# comments are ok
# simple form
net default
# it's smart enough to delete the previous default
net default 
# routes to specific hosts
# netmasks optional
# if field 1 isn't host or net, it's ignored

Another advantage of this script is that when called with "stop" (/etc/rc2.d/S90iproute stop), it will delete the routes listed in the file.

The "routed" daemon can reset your routes- disable it (edit /etc/tcp) if you are not using it.

"routed" appears in several places. You want the line between if/fi that actually runs it:

    routed &
    echo "routed \c"

I usually make it:

    # routed &
    echo "not starting routed \c"


I have been known to complain when someone responds to a request regarding setting a default route and only mentions the rc2.d method. My reason is that incomplete explanations will only cause problems for someone else.

I think it is particularly important to mention the changes in 5.0.6. Not being aware of that will just cause confusion and trouble for someone who reads that post and implements that advice on a 5.0.6 system. It may not cause trouble for them, but it will for someone who comes along later and is aware of the 5.0.6 method but ignorant of the rc2.d file.

The same is true for someone with 5.0.4 where Internet Manager had been used previously or will be used subsequently - not having the full picture will just cause frustration.

That's why I complain about this type of post: it WILL cause problems for some people, particularly people who lack the general experience and knowledge to figure this out for themselves.

It is truly unfortunate that SCO never addressed the standardization of this much earlier.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> How do I add a default route? (SCO Unix)

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

Your computer needn't be the first thing your see in the morning and the last thing you see at night. (Simon Mainwaring)





Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode