- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- netstat -rn, static route add script ..?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2002 12:22 PM
10-15-2002 12:22 PM
netstat -rn, static route add script ..?
We have a server with a ton of static network routes and they get added and no one keeps track of what was added. The server had to be rebooted and of course the routes were not added back in.
I am aware that we can add routes in /etc/rc.configd/netconf .. and if netconf cant hold them add another start up script to add the routes.
But I was thinkig if there was a way to set up a scrit via cron that would do a netstat -rn .. get all the junk out and some how turn the netstat -rn into a route add script with the correct values and route add net statements that can be ran manualy if the box is rebooted.
~ Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2002 12:25 PM
10-15-2002 12:25 PM
Re: netstat -rn, static route add script ..?
Richard,
Write it in perl, but better yet, have people use the script to add entries into the netconf file, that way it survives the reboot.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2002 01:18 PM
10-15-2002 01:18 PM
Re: netstat -rn, static route add script ..?
You can write a script to capture netstat -rn output and dump the contents into a script using awk constructs.
While the subnets can be easily captured from netstat output, the challenge will be to determine the netmasks.
I would suggest not to work hard on getting it scripted. As a system administrator, you will need to keep track of what you do. While adding the route, make sure you also add it to a file so that you can simply excute the file after reboot. You can put it in the startup to automate during the boot. If you have many static routes, modifying netconf may be cumbersome.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2002 01:23 PM
10-15-2002 01:23 PM
Re: netstat -rn, static route add script ..?
I agree with Sri. If I were going to write a script to help with this problem, I would write one that would go the opposite direction. I would check the netconf file against the output of netstat -rn and have it e-mail me if there were any routes in use that weren't in the netconf file. Then I could investigate them, add them if needed, and punish the offenders who added routes without updating netconf correctly.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2002 01:36 PM
10-15-2002 01:36 PM
Re: netstat -rn, static route add script ..?
It is better to set it once in the netconf file as this is place where the sytem reads during startup . why do u want to do the work again and again .
You can look at this document which is comprehensive in this aspect :
http://www1.itrc.hp.com/service/cki/docDisplay.do?docId=200000049791567
Manoj Srivastav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2002 01:36 PM
10-15-2002 01:36 PM
Re: netstat -rn, static route add script ..?
A variation on Harry's theme....write a wrapper around the route command that not only executes the actual route add/delete, but that adds/deletes the entries to/from the netconf file as well.
But, Sridhar & John are correct as well i.e. SAs are supposed to document *whatever* is changed on a system & a route change is certainly one of them.
My 2 cents,
Jeff