Operating System - HP-UX
1834796 Members
2499 Online
110070 Solutions
New Discussion

permanent entries in netstat

 
so.nimda
Super Advisor

permanent entries in netstat

hi,

i have a question on routing in ux...

if i add an entry using the netstat command, on the next reboot of the server, this entry will be gone, is that right?

how do i add it as a permanent entry so that even after reboot, it will not be lost?

thanks in advance !!

:)
6 REPLIES 6
Rajeev  Shukla
Honored Contributor

Re: permanent entries in netstat

netstat command it to display the network status. I am sure you must have used route command to add the routing entry.

Yes when you reboot the server the entry will be lost and to make the entry permanent you need to either edit the /etc/rc.config.d/netconf file and add entries there
ROUTE_DESTINATION
ROUTE_MASK
ROUTE_COUNT
ROUTE_ARGS
or write a simple script which runs the route command and put that script in your system startup scripts
Sung Oh
Respected Contributor

Re: permanent entries in netstat

Hi,

You can consider using set_parms for network configuration.

and here is how you can add routing value to a file.

To add a default route:
# route add default 130.100.10.1

Verify
# netstat -nr

Test
# ping myhost.com

To flush all routing entries
# route -f

example of adding routing value to netconf file
# vi /etc/rc.config.d/netconf

Add or modify following entries
ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="130.100.10.1"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

must reboot take effect
# shutdown -ry 0

you need to change the value of "130.100.10.1" to your routing IP address.

Regards,
Sung
so.nimda
Super Advisor

Re: permanent entries in netstat

hi rajeev,

thanks for the reply...

and yes... it's "route add" for adding of entries... sorry for the confusion...

thanks for the tip...

:)
so.nimda
Super Advisor

Re: permanent entries in netstat

hi sung,

thanks for the very detailed reply...

i will give it a try...

cheers !!

:)
so.nimda
Super Advisor

Re: permanent entries in netstat

the replies were very helpful in providing the solution...
Rajeev  Shukla
Honored Contributor

Re: permanent entries in netstat

Hi Rancid,

I am surrprised about all your threads!!
You close the thread with your remark as problem solved and a bunny appears on the thread
BUT NO POINTS FOR THE PEOPLE WHO PUT THEIR EFFORT IN REPLYING..

Regards
Rajeev