How to add persistent/permanent routes in windows and linux

We can add static route in the system using route add command from the command prompt or terminal. But these routes gets erased when we reboot the system. To make your route's persistent even after reboot. follow below command on Windows or Linux

On Windows :

In Command Prompt, Run command as below

C:\> route -p add   mask  172.16.193. 100 metric 1

-p switch will make the route persistent on windows.
On Linux :
  1. Open Terminal , with root privileges create/edit below file to add the route details as below
           $ vim /etc/sysconfig/network-scripts/route-eth0

     2.   Add the route details like below and save the file.

     3.   Restart the network service by running " /etc/init.d/network restart ". Now you should be able connect the systems under network through gateway.

Note : if your ip address is configured to eth1 port then you would have to create " route-eth1 " file at "/etc/sysconfig/network-scripts/ " with route details in it.


Popular posts from this blog

How to disable USB ports on Mac OS X Mavericks, Yosemite or El Capitan ?