Need to create static routes in HP-UX 10.x

I am trying to create static routes in HP-UX 10.x. I can create the routes however they will not survive a restart (route add net 10.0.x.0 10.0.x.1 1). Any advice on a file I can edit to restore these routes on restart? TIA
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.

You can use SAM to add the route, which will make it permanent,

Or you can do the same thing manually:

Set the route temporarily with, e.g
route add net netmask 1

Edit /etc/rc.config.d/netconf and add the details in the form:

(Where [1] is a unique number for each route you want to add) so that when the netconf file is read at boot time, the route gets added.

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
An alternative would be to create a shell script in /sbin/rc3.d/S99static_routes that contains something like:


/sbin/route add net netmask 1
/sbin/route add net netmask 1

P.S. Don't forget to make it executable
True, that would work - But it's not the standard way under HP-UX, and will cause confusion for anyone else trying to support the system ;-)
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

agreed with tfewster.

the standard way to do it in HP-UX is to use SAM.

If you manually edit /etc/rc.config.d/netconf  (as http#12383997)  (static routing),
you also need to run:
    /sbin/rc2.d/S340net stop
    /sbin/rc2.d/S340net start
hmmm... You are right it is not the "right" way, not even in Solaris (my orientation). However i have seen this in so many enviroments that it is somehow standard to me :-)

I saw a similar problem on a Sun box last night - A colleague had added swap slices manually and edited /etc/init.d/swapadd to make them permanent - But someone else had created /etc/rc3.d/S99swapadd as a file, _not_ a link to /etc/init.d/swapadd - So when the box rebooted and started Oracle, it immediately ran out of swap & crashed...

Of course, it only took a few minutes to find what the problem was once we booted to single-user. But as the system took 20+ minutes to reboot each time it crashed, a lot of time was wasted overall.  So forgive me if I'm rude about "non-standard" solutions ;-)
mothman999Author Commented:
Thanks muchly!
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
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.