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 192.168.1.0   mask 255.255.255.0  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.
           
            192.168.1.0/24 via 172.16.193.100


     3.   Restart the network service by running " /etc/init.d/network restart ". Now you should be able connect the systems under 192.168.1.0/24 network through 172.16.193.100 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.





Comments

Popular posts from this blog

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

How to enable root login in gnome on Debian 6 or 7