2022-11-08 14:56:59 +01:00
|
|
|
# ip route show
|
|
|
|
|
|
|
|
> Display subcommand for IP Routing table management.
|
|
|
|
> More information: <https://manned.org/ip-route>.
|
|
|
|
|
|
|
|
- Display the routing table:
|
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`ip {{[r|route]}} show`
|
2022-11-08 14:56:59 +01:00
|
|
|
|
|
|
|
- Display the main routing table (same as first example):
|
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`ip {{[r|route]}} show {{main|254}}`
|
2022-11-08 14:56:59 +01:00
|
|
|
|
|
|
|
- Display the local routing table:
|
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`ip {{[r|route]}} show table {{local|255}}`
|
2022-11-08 14:56:59 +01:00
|
|
|
|
|
|
|
- Display all routing tables:
|
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`ip {{[r|route]}} show table {{all|unspec|0}}`
|
2022-11-08 14:56:59 +01:00
|
|
|
|
|
|
|
- List routes from a given device only:
|
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`ip {{[r|route]}} show dev {{eth0}}`
|
2022-11-08 14:56:59 +01:00
|
|
|
|
|
|
|
- List routes within a given scope:
|
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`ip {{[r|route]}} show scope link`
|
2022-11-08 14:56:59 +01:00
|
|
|
|
|
|
|
- Display the routing cache:
|
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`ip {{[r|route]}} show cache`
|
2022-11-08 14:56:59 +01:00
|
|
|
|
|
|
|
- Display only IPv6 or IPv4 routes:
|
|
|
|
|
2025-03-09 01:35:31 +02:00
|
|
|
`ip {{-6|-4}} {{[r|route]}} show`
|