mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-02 01:54:33 +00:00
Update cheatsheets
This commit is contained in:
37
linux/ip-route
Normal file
37
linux/ip-route
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ip route
|
||||
|
||||
> IP Routing table management subcommand.
|
||||
> More information: <https://manned.org/ip-route>.
|
||||
|
||||
- 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}}`
|
||||
Reference in New Issue
Block a user