How to add, remove and display Static Route on Windows 2008/2012?

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 mask 172.16253.254

  • It indicates that any packets to 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 mask 172.16253.254

C) Delete the route

route delete

References :


Leave a Reply

Your email address will not be published. Required fields are marked *