From 92378c0ddeb56475b40609064cc91a798ace32ce Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Tue, 25 Feb 2014 10:25:47 +0800 Subject: [PATCH 1/2] add ip.md --- linux/ip.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 linux/ip.md diff --git a/linux/ip.md b/linux/ip.md new file mode 100644 index 0000000000..3e3ae96732 --- /dev/null +++ b/linux/ip.md @@ -0,0 +1,23 @@ +# ip + +> Show / manipulate routing, devices, policy routing and tunnels + +- List interfaces with detailed info + +`ip a` + +- Display the routing table + +`ip r` + +- Make an interface up/down + +`ip link set {{interface}} up/down` + +- Add/Delete an ip address to an interface + +`ip addr add {{ip}}/{{mask}} dev {{interface}}` + +- Add an default route + +`ip route add default via {{ip}} dev {{interface}}` From e596478ae0b07ee7d846570a9d27c4d6ea536c51 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Tue, 25 Feb 2014 10:28:45 +0800 Subject: [PATCH 2/2] fix the example command to match description --- linux/ip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/ip.md b/linux/ip.md index 3e3ae96732..292da24282 100644 --- a/linux/ip.md +++ b/linux/ip.md @@ -16,7 +16,7 @@ - Add/Delete an ip address to an interface -`ip addr add {{ip}}/{{mask}} dev {{interface}}` +`ip addr add/del {{ip}}/{{mask}} dev {{interface}}` - Add an default route