ip-route-add
adds new routes to the kernel routing tables
TLDR
Add a default route via gateway
SYNOPSIS
ip route add destination [options]
DESCRIPTION
ip route add adds new routes to the kernel routing tables. Routes determine how packets are forwarded to their destinations based on the destination address.
A route specifies either a gateway (next-hop router) to forward packets to, or an interface for directly connected networks. Multiple routing tables can be used for policy routing.
PARAMETERS
default
Default route (0.0.0.0/0 or ::/0)via GATEWAY
Next-hop gateway addressdev DEVICE
Output device nametable TABLE
Routing table (number or name)metric NUM
Route preference (lower = preferred)src ADDRESS
Preferred source addressproto PROTOCOL
Routing protocol identifier
CAVEATS
Requires root privileges. Routes are not persistent across reboots without additional configuration. Adding conflicting routes may fail or create unexpected behavior.
HISTORY
The ip route command is part of iproute2, which replaced the older route command from net-tools. iproute2 provides unified management of all Linux networking features.
SEE ALSO
ip(8), ip-route(8), ip-route-list(8), ip-rule(8)
