route Command – Complete Reference (Windows)The route command is used to view and manipulate the IP routing table in Windows. It allows adding, deleting, or displaying network routes.
route [command] [destination] [mask netmask] [gateway] [metric cost] [if interface]
| Command | Description |
|---|---|
PRINT |
Display the routing table |
ADD |
Add a route to the table |
DELETE |
Delete a route from the table |
CHANGE |
Modify an existing route |
| Option | Description |
|---|---|
MASK <netmask> |
Specifies a subnet mask (default: 255.255.255.255) |
METRIC <value> |
Sets the route cost (lower = higher priority) |
IF <index> |
Specifies interface by index (from route print) |
-p |
Makes the route persistent (survives reboot, for ADD only) |
/? |
Display help for the command |
route print
Lists all active routes and interface list.
route add 192.168.10.0 mask 255.255.255.0 192.168.1.1
Adds route to 192.168.10.0/24 via 192.168.1.1.
route -p add 10.0.0.0 mask 255.0.0.0 192.168.1.1
Persists after reboot.
route change 10.0.0.0 mask 255.0.0.0 192.168.1.254
Changes the gateway for the route.
route delete 192.168.10.0
Removes the route to that destination.
route print)IPv4 Route Table
===========================================================================
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.10 25
127.0.0.0 255.0.0.0 On-link 127.0.0.1 1
| Task | Command Example |
|---|---|
| View current routes | route print |
| Add a route | route add <dest> mask <mask> <gateway> |
| Add a persistent route | route -p add <dest> mask <mask> <gateway> |
| Change a route | route change <dest> mask <mask> <new_gateway> |
| Delete a route | route delete <dest> |
| Help/Usage Info | route /? |
route print output under Interface List.The route command is a powerful tool for managing static routes, diagnosing routing issues, and controlling how traffic is forwarded across networks in Windows.