Forrest logo
tool overview
On this page you find all important commands for the CLI tool route. If the command you are looking for is missing please ask our AI.

route

The "route" command line tool is commonly used in operating systems like Linux, macOS, and Windows to display and manipulate the IP routing table. It allows users to view, configure, and manage the network routing settings.

By typing "route" in the command line, users can view the current routing table that determines how network packets are handled and forwarded. This table includes information about destinations, gateways, and associated metrics.

The "route" command also enables users to add new routes, delete existing ones, modify metric values, and change network interfaces. It provides a way to control how traffic is directed from one network to another.

Using the appropriate parameters, users can specify the destination IP address, subnet masks, gateway IP, and network interface to configure or manipulate the routing table.

The "route" command can be handy for troubleshooting network issues, examining the routing paths, and diagnosing network connectivity problems. It can help in determining if packets are being sent to the expected destination or if they are encountering any routing issues.

In addition to displaying the routing table, the "route" command can also show various statistics and details related to network interfaces, such as the number of sent or received packets and bytes, as well as error and discard counts.

The "route" command supports both IPv4 and IPv6 protocols, allowing users to manage routes for different types of IP networks.

After making changes to the routing table using the "route" command, the modifications are typically temporary and do not persist across reboots. However, in some systems, it is possible to make changes persistent by modifying configuration files or using additional commands.

The "route" command is often used in conjunction with other networking tools, such as "ping" or "traceroute," to test and verify network connectivity and to trace the path taken by packets.

Overall, the "route" command line tool provides a flexible and powerful way to manage the IP routing table, enabling users to control network traffic and troubleshoot network issues effectively.

List of commands for route:

  • route:tldr:11241 route: Lookup and display the route for a destination (hostname or IP address).
    $ sudo route get "${destination}"
    try on your machine
    explain this command
  • route:tldr:1bf49 route: Add route rule.
    $ sudo route add -net ${ip_address} netmask ${netmask_address} gw ${gw_address}
    try on your machine
    explain this command
  • route:tldr:25d82 route: Add a route to a /24 subnet through a gateway.
    $ sudo route add "${subnet_ip_address}/24" "${gateway_address}"
    try on your machine
    explain this command
  • route:tldr:345fb route: Run in test mode (does not do anything, just print).
    $ sudo route -t add "${destination_ip_address}/24" "${gateway_address}"
    try on your machine
    explain this command
  • route:tldr:4de18 route: Display the information of route table.
    $ route -n
    try on your machine
    explain this command
  • route:tldr:4f423 route: Delete route rule.
    $ sudo route del -net ${ip_address} netmask ${netmask_address} dev ${gw_address}
    try on your machine
    explain this command
  • route:tldr:70227 route: Add a route to a destination through a gateway.
    $ sudo route add "${destination_ip_address}" "${gateway_address}"
    try on your machine
    explain this command
  • route:tldr:a51d2 route: Delete a specific route.
    $ sudo route delete "${destination_ip_address}/24"
    try on your machine
    explain this command
  • route:tldr:d8441 route: Remove all routes.
    $ sudo route flush
    try on your machine
    explain this command
tool overview