By referring to wikipedia, Static routing is a form of routing that occurs when a router uses a manually-configured routing entry, rather than information from a dynamic routing traffic.
Static routes are usually configured at the router level but you can also configure them from you locally (Windows OS) via command line.
Below are the few useful command line to work with static route in Windows.
A) To show the routing table, there are two command available
- route print
- netstat -rn
B) Add Static route
route [-f] [-p] [Command [Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]
route add 172.18.104.0 mask 255.255.255.0 172.16253.254
- It indicates that any packets to 172.18.104.0/24 network should be forwarded to 172.16253.254 router (gateway). This static route will disappear after you reboot/shutdown the computer. To make it permanent and save in Windows OS routing table, we should use –p key with the route add command. So, permanent static route add on Windows 10 command will be like following;
route add -p 172.18.104.0 mask 255.255.255.0 172.16253.254
C) Delete the route
route delete 172.18.104.0
References : https://technet.microsoft.com/en-us/library/bb490991.aspx