Difference between revisions of "Windows routes"

From MyWiki
Jump to: navigation, search
(Created page with "Adding the static route: route add <destination> mask <netmask> <gateway> Destination = The destination network address. Netmask = The netmask for the destination network. G...")
 
 
Line 3: Line 3:
 
route add <destination> mask <netmask> <gateway>
 
route add <destination> mask <netmask> <gateway>
  
Destination = The destination network address.
+
Destination = The destination network address.<br>
Netmask = The netmask for the destination network.
+
Netmask = The netmask for the destination network.<br>
Gateway = The gateway/router ip address to route the traffic through.
+
Gateway = The gateway/router ip address to route the traffic through.<br>
  
 
eg:
 
eg:

Latest revision as of 13:38, 7 August 2014

Adding the static route:

route add <destination> mask <netmask> <gateway>

Destination = The destination network address.
Netmask = The netmask for the destination network.
Gateway = The gateway/router ip address to route the traffic through.

eg:

route add 192.168.200.0 mask 255.255.255.0 192.168.0.254

This adds a route for the 192.168.200.0/24 network, so that traffic destined for this network gets routed through 192.168.0.254. The gateway address must be on on the same network subnet that you are on.

To make a route persistent across reboots, make sure to add the “-p” parameter to the route command.

route -p add 192.168.200.0 mask 255.255.255.0 192.168.0.254

Test connectivity using the ping and tracert (trace route) commands to make sure the destination network is accessible and going via the correct route.