commands.sh

ip route add

linux

Add a new networking route.

More info →

Options (3)

boolean

Add a default route using gateway forwarding

Example: sudo ip {{[r|route]}} {{[a|add]}} default via {{gateway_ip}}
boolean

Add a default route using gateway forwarding

Example: sudo ip {{[r|route]}} {{[a|add]}} default via {{gateway_ip}}
boolean

Add a route to a specific routing table

Example: sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} dev {{ethX}} {{[t|table]}} {{ip_address}}

Examples (4)

Add a default route using gateway forwarding

sudo ip [r|route] [a|add] default via gateway_ip

Add a default route using `ethX`

sudo ip [r|route] [a|add] default dev ethX

Add a static route

sudo ip [r|route] [a|add] destination_ip via gateway_ip dev ethX

Add a route to a specific routing table

sudo ip [r|route] [a|add] destination_ip dev ethX [t|table] ip_address
made by @shridhargupta | data from tldr-pages