Monday, February 12, 2007

Add a Net With a Static Route

I have several static routes setup on my workstation. These routes are started at boot time. They are reliable because my network topology doesn't change often. If it does change, I know that I need to make modifications in the script.

Here's an example.

#vi /etc/rc3.d/S97static_routes
#!/usr/bin/sh
route add net 192.168.100.0 192.168.105.1 1
:wq! (quits and saves)

I just added the class C network 192.168.100.0 via the router 192.168.105.1. These IPs are only used for illustration purposes.

To manipulate the routing table
Route Add, Route Change, Route Delete, Route Monitor, Route Flush

2 comments:

UX-admin said...

Tip:

on Solaris 10 and on, you can use routeadm(1M) to manage routing, instead of having to edit /etc/init.d/ script(s) manually.

esofthub said...

Thanks ux-admin for the Solaris 10 tip. Looking forward to your next comment.