Mike's PBX Cookbook

PC Static Routes

From the Command Prompt (cmd):


1 To Print all static routes:

route PRINT - list network destinations and associated gateways

examples:

> route PRINT             all routes
> route PRINT -4          IPv4 routes
> route PRINT -6          IPv6 routes
> route PRINT 157*        matching 157*


2 To Add a static route:

route ADD [destination] [MASK netmask] [gateway] [METRIC metric] [IF interface]
- MASK, METRIC, and IF are optional (netmask 255.255.255.0 is assumed if not specified)
- use -p (optional) to make the route 'persistent', eg, survive a reboot

example:

C:\>route -p add 192.168.1.0 mask 255.255.255.0 192.168.0.254
 OK!

The 'route add' command should respond with 'OK!'

If the response is 'The requested operation requires elevation', we need to run as administrator:


3 To Delete a static route:

route DELETE [destination]

example:

C:\>route delete 192.168.1.0
 OK!

Print route again to confirm its gone.

With PRINT or DELETE, the [destination] or [gateway] can be wild. '*' matches any string, and '?' matches any character. Use the command route /? for more information.