Normally, if you use the man command to find out the method to add routes to the SUN machine, it will come up with the ‘route add’ command but is that command enough to add the routes securely to the system? Well, let us find it out. Before getting involved, just for the sake of knowledge, you can use ‘man’ command with ‘-k’ option to find keywords in the SUN Unix manual.

Adding temporary routes

The ‘route add’ command is used to add the routes temporary to the system which effectively means that as soon as you reboot the system, boom!, the routes will be gone. Well, that happened to me on one site where our clients rebooted the system somehow without the knowledge that they had been adding the routes with ‘route add’ command in the system. We had to arrange a training session right after that break happened. Coming back to the point, let us see some examples to how you can add the routes temporarily.

#route  add  –host   202.12.16.100   202.12.17.1

This command will add the route to the host address 202.12.16.100 and gets to it via gateway address 202.12.17.1.

#route add  –net  204.12.16.0  204.12.17.1

This command will add a route to complete network instead of a single host. Note the difference with previous command as well. First, the option ‘-net’ has been used for network. Second, the address is a network address 204.12.16.0.

#route add default 204.54.56.1

This command will add one default gateway to the system. It will route all the addresses, which are unknown, to this address. Default gateway is used in case the system requires internet connectivity or it is an end system with only one way out to reach other networks.

Adding permanent routes

To add the routes permanently, you need to modify the S98file which is located at /etc/rc3.d/S98route. In the file, you add the hosts with ‘-host’ option and networks with ‘-net’ option. After adding the routes to it, save the file. At this stage, the new routes will not be updated to the system route list. To add them without restarting the server, use ‘./S98route’ to add the routes to the current list.

Adnan Khurshid

Adnan Khurshid, the author of this article, has been working in a telecommunication sector since 2007. He has worked there as a VAS (Value Added Services) engineer and has excelled remarkably in the field. Working in this field has been his passion and he has always made efforts to keep himself up to date. Find more about him on LinkedIn

More Posts

Tags: , , , ,

Leave a Reply