Displays and modifies the entries in the local IP routing table. If used without parameters, route displays help at the command prompt.
Important This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network Connections. Syntaxroute [/f] [/p] [<command> [<destination>] [mask <netmask>] [<gateway>] [metric <metric>]] [if <interface>]]Parameters
ExamplesTo display the entire contents of the IP routing table, type: route printTo display the routes in the IP routing table that begin with 10, type: route print 10.*To add a default route with the default gateway address of 192.168.12.1, type: route add 0.0.0.0 mask 0.0.0.0 192.168.12.1To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0 and the next hop address of 10.27.0.1, type: route add 10.41.0.0 mask 255.255.0.0 10.27.0.1To add a persistent route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0 and the next hop address of 10.27.0.1, type: route /p add 10.41.0.0 mask 255.255.0.0 10.27.0.1To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, the next hop address of 10.27.0.1, and the cost metric of 7, type: To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, the next hop address of 10.27.0.1, and using the interface index 0x3, type: route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 if 0x3To delete the route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, type: route delete 10.41.0.0 mask 255.255.0.0To delete all routes in the IP routing table that begin with 10, type: route delete 10.*To change the next hop address of the route with the destination of 10.41.0.0 and the subnet mask of 255.255.0.0 from 10.27.0.1 to 10.27.0.25, type: route change 10.41.0.0 mask 255.255.0.0 10.27.0.25Additional References
On a Windows host, the route print or netstat -r command can be used to display the host routing table. Both commands generate the same output. The output may seem overwhelming at first, but is fairly simple to understand. Entering the netstat -r command or the equivalent route print command, displays three sections related to the current TCP/IP network connections:
Note: Command output varies, depending on how the host is configured and the interface types it has. The figure displays the IPv4 Route Table section of the output. Notice the output is divided into five columns which identify:
|