From 0e6c1a8d08079d97efa6a3c4be27791a4a1398c7 Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Sun, 23 Mar 2025 11:23:16 +0200 Subject: [PATCH] ip-route-add: add page (#15994) --- pages/linux/ip-route-add.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/linux/ip-route-add.md diff --git a/pages/linux/ip-route-add.md b/pages/linux/ip-route-add.md new file mode 100644 index 0000000000..297b428f76 --- /dev/null +++ b/pages/linux/ip-route-add.md @@ -0,0 +1,20 @@ +# ip route + +> Add a new networking route. +> More information: . + +- Add a default route using gateway forwarding: + +`sudo ip {{[r|route]}} {{[a|add]}} default via {{gateway_ip}}` + +- Add a default route using `eth0`: + +`sudo ip {{[r|route]}} {{[a|add]}} default dev {{eth0}}` + +- Add a static route: + +`sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} via {{gateway_ip}} dev {{eth0}}` + +- Add a route to a specific routing table: + +`sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} dev {{eth0}} {{[t|table]}} {{ip}}`