Route for Linux was originally written by Fred N. van Kempen, and then modified by Johannes Stille and Linus Torvalds for pl15. Alan Cox added the mss and window options for Linux 1.1.22. irtt support and merged with netstat from Bernd Eckenfels.

Route manipulates the kernel’s IP routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured with the ifconfig(8) program.

To add a Static Route in Solaris you need use route command this will manipulates the Kernel’s IP Routing Tables.
If you reboot the server the dynamic route will be lost to avoid this happening in future just create a script to start it in one of the /etc/rcX.d directories such as

/etc/rc2.d or /etc/rc3.d something like S99route.

Method (1)
root@techgyaan:~# route add [net|host] netmask [GatewayAddr|-interface ]


root@techgyaan:~# route add -net netmask
root@techgyaan:~# route add -net

to check the route

root@techgyaan:~# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags Mss Window irtt Iface U 1 273 hme0 U 1 0 hme0

To make this entires permanent next time you reboot your machine “route add” under /etc/rc2.d or /etc/rc2.d S99route startup file.

root@techgyaan:~# vi /etc/rc2.d/S99route
route add -net netmask

save & close the file

set the file to executable for owner, set owner as root. Now when you reboot, your route gets added

root@techgyaan:~# chmod 744 /etc/rc2.d/S99route

### String Owner’s Permissions Group’s Permissions Other’sPermissions
744 -rwxr–r– Read,Write & Execute Read Read

Method (2)

This method is just smiple.
Just create file under /etc/defaultrouter

/etc/defaultrouter is configuration file containing the hostnames or IP adresses of one or more default routers.

to check present routing table.

root@techgyaan:~# netstat -rn (netstat - show network status)

Create file /etc/defaultrouter
root@techgyaan:~# touch /etc/defaultrouter
root@techgyaan:~# vi /etc/defaultrouter

Save & close the file.

Fore more details on above commands refer man:
man route
man netstat
man defaultrouter
man chmod

Feedbacks: We appreciate feedbacks and suggestions about our website

Your Ad Here