ip Verified current stable Not installed? Networking

Ip / Add Default Route Gateway Linux

Add Default Route Gateway Linux

Ip command syntax to add default route gateway linux. Copyable examples, output expectations, and common mistakes.

$
Terminal
sudo ip r a default via <gateway_ip>

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
sudo ip r a default via <gateway_ip>

Command Breakdown

What each part is doing

sudo
Base Command
The executable that performs this operation. Here it runs Ip before the shell applies any redirect operators.
r
r|route
The value supplied for r|route.
a
a|add
The value supplied for a|add.
<gateway_ip>
gateway ip
The value supplied for gateway ip.

Alternative Approaches

Comparable commands in other tools

Alternative networking tools for the same job.