Forrest logo
back to the ip tool

ip:tldr:c172f

ip: Add a default route.
$ ip route add default via ${ip} dev ${interface}
try on your machine

This command is used to add a default route in the routing table of a device.

The ip route add part indicates that the command is related to adding a new route.

The default parameter specifies that this route will be used as the default route, meaning that any traffic that does not match any other routes in the routing table will be sent through this route.

The via ${ip} specifies the next-hop IP address for the default route. This is the IP address of the next device in the network path towards the destination.

The dev ${interface} parameter specifies the outgoing network interface through which the traffic will be sent. This interface is typically the physical or virtual network interface connected to the next-hop IP address specified in the via parameter.

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 ip tool