route

route command is another network troubleshooting tool used available in Windows, Linux, Unix-like systems, IBM OS, and ReactOS. It is used to display and make changes to routing tables. The command comes with many parameters, with which you can clear the routing table, set network destination, set the command to use IPv4 or Ipv6, and more. 

Key functionalities:
  • route printDisplays the current routing table, showing active routes, interface information, and metrics. 
  • route addAdds a new static route to the routing table. 
  • route deleteRemoves an existing static route from the routing table. 
  • route changeModifies an existing static route. 
How to use the route command:
  1. Open a Command Prompt or PowerShell as administrator .
  2. Type the route command followed by the desired action and parameters For example:
    • route print (to view the routing table)
    • route add <destination> MASK <netmask> <gateway> METRIC <metric> (to add a static route)
    • route delete <destination> MASK <netmask> <gateway> (to delete a static route)
  3. Press Enter to execute the command . 
Example:
To add a static route to reach the network 192.168.1.0/24 through the gateway 192.168.1.1 with a metric of 1:
code
route add 192.168.1.0 MASK 255.255.255.0 192.168.1.1 METRIC 1
Important notes:

  • The route command requires administrator privileges. 
  • You can use the -p option with the add command to make a route persistent, meaning it will be preserved after a system restart. 
  • The route command can be used with different parameters to fine-tune its behavior, such as specifying the interface or using the -f option to clear the routing table before adding or modifying routes.