1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-03 12:35:22 +02:00
tldr/pages/linux/ip.md

38 lines
828 B
Markdown
Raw Normal View History

2014-02-25 10:25:47 +08:00
# ip
> Show/manipulate routing, devices, policy routing and tunnels.
> Some subcommands such as `address` have their own usage documentation.
> More information: <https://www.manned.org/ip.8>.
2014-02-25 10:25:47 +08:00
- List interfaces with detailed info:
2014-02-25 10:25:47 +08:00
`ip {{[a|address]}}`
2020-10-06 13:12:54 +02:00
- List interfaces with brief network layer info:
2025-06-20 06:06:16 +03:00
`ip {{[-br|-brief]}} {{[a|address]}}`
2020-10-06 13:12:54 +02:00
- List interfaces with brief link layer info:
2025-06-20 06:06:16 +03:00
`ip {{[-br|-brief]}} {{[l|link]}}`
2014-02-25 10:25:47 +08:00
- Display the routing table:
2014-02-25 10:25:47 +08:00
`ip {{[r|route]}}`
2014-02-25 10:25:47 +08:00
- Show neighbors (ARP table):
`ip {{[n|neighbour]}}`
- Make an interface up/down:
2014-02-25 10:25:47 +08:00
`sudo ip {{[l|link]}} {{[s|set]}} {{ethX}} {{up|down}}`
2014-02-25 10:25:47 +08:00
- Add/Delete an IP address to an interface:
2014-02-25 10:25:47 +08:00
`sudo ip {{[a|address]}} {{add|delete}} {{ip}}/{{mask}} dev {{ethX}}`
2014-02-25 10:25:47 +08:00
- Add a default route:
2014-02-25 10:25:47 +08:00
`sudo ip {{[r|route]}} {{[a|add]}} default via {{ip}} dev {{ethX}}`