Forrest logo
back to the route tool

route:tldr:4f423

route: Delete route rule.
$ sudo route del -net ${ip_address} netmask ${netmask_address} dev ${gw_address}
try on your machine

This command is used to delete a specific network route from the routing table on a Unix-like operating system. Here's a breakdown of each component of the command:

  • sudo: This command is used to execute the subsequent command with administrative privileges. It allows the user to run the command as a superuser or another user with appropriate permissions.

  • route: It is the command-line utility for managing the IP routing table. It allows you to view, add, or delete entries in the kernel's routing table.

  • del: This option specifies that we want to delete (remove) a route from the routing table.

  • -net ${ip_address}: Specifies the IP address or network address of the route to be deleted. You need to replace ${ip_address} with the actual IP address or network address you want to delete.

  • netmask ${netmask_address}: Defines the network mask associated with the network route. The ${netmask_address} should be replaced with the actual netmask address associated with the route you want to delete.

  • dev ${gw_address}: Specifies the network device through which the traffic should be routed. ${gw_address} should be replaced with the IP address of the network gateway associated with the route you want to delete.

Once the command is executed, it will remove the specified route from the routing table, preventing the system from using that route for incoming or outgoing network traffic.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the route tool