From 7d38f9d22848468ebd5dd784e1cbe924bf893e73 Mon Sep 17 00:00:00 2001 From: Patrice Denis Date: Sat, 10 Apr 2021 21:17:47 +0200 Subject: [PATCH] ip-route: add page (#5696) --- pages/linux/ip-route.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pages/linux/ip-route.md diff --git a/pages/linux/ip-route.md b/pages/linux/ip-route.md new file mode 100644 index 000000000..d48de0d88 --- /dev/null +++ b/pages/linux/ip-route.md @@ -0,0 +1,32 @@ +# ip route + +> IP Routing table management subcommand. +> More information: . + +- Display the routing table: + +`ip route {{show|list}}` + +- Add a default route using gateway forwarding: + +`sudo ip route add default via {{gateway_ip}}` + +- Add a default route using `eth0`: + +`sudo ip route add default dev {{eth0}}` + +- Add a static route: + +`sudo ip route add {{destination_ip}} via {{gateway_ip}} dev {{eth0}}` + +- Delete a static route: + +`sudo ip route del {{destination_ip}} dev {{eth0}}` + +- Change or replace a static route: + +`sudo ip route {{change|replace}} {{destination_ip}} via {{gateway_ip}} dev {{eth0}}` + +- Show which route will be used by the kernel to reach an IP address: + +`ip route get {{destination_ip}}`