2014-02-25 02:25:47 +00:00
|
|
|
# ip
|
|
|
|
|
2023-06-13 18:14:43 +01:00
|
|
|
> Show/manipulate routing, devices, policy routing and tunnels.
|
2021-09-13 09:21:21 +01:00
|
|
|
> Some subcommands such as `ip address` have their own usage documentation.
|
2024-06-18 16:08:28 +01:00
|
|
|
> More information: <https://www.manned.org/ip.8>.
|
2014-02-25 02:25:47 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- List interfaces with detailed info:
|
2014-02-25 02:25:47 +00:00
|
|
|
|
2020-10-06 12:12:54 +01:00
|
|
|
`ip address`
|
|
|
|
|
|
|
|
- List interfaces with brief network layer info:
|
|
|
|
|
|
|
|
`ip -brief address`
|
|
|
|
|
|
|
|
- List interfaces with brief link layer info:
|
|
|
|
|
|
|
|
`ip -brief link`
|
2014-02-25 02:25:47 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Display the routing table:
|
2014-02-25 02:25:47 +00:00
|
|
|
|
2020-10-06 12:12:54 +01:00
|
|
|
`ip route`
|
2014-02-25 02:25:47 +00:00
|
|
|
|
2018-07-16 16:00:02 +01:00
|
|
|
- Show neighbors (ARP table):
|
|
|
|
|
2020-10-06 12:12:54 +01:00
|
|
|
`ip neighbour`
|
2018-07-16 16:00:02 +01:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Make an interface up/down:
|
2014-02-25 02:25:47 +00:00
|
|
|
|
2023-12-27 06:22:49 +00:00
|
|
|
`ip link set {{interface}} {{up|down}}`
|
2014-02-25 02:25:47 +00:00
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Add/Delete an IP address to an interface:
|
2014-02-25 02:25:47 +00:00
|
|
|
|
2014-02-25 02:28:45 +00:00
|
|
|
`ip addr add/del {{ip}}/{{mask}} dev {{interface}}`
|
2014-02-25 02:25:47 +00:00
|
|
|
|
2017-03-29 16:20:39 +01:00
|
|
|
- Add a default route:
|
2014-02-25 02:25:47 +00:00
|
|
|
|
|
|
|
`ip route add default via {{ip}} dev {{interface}}`
|