mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-07 04:57:02 +00:00
Update cheatsheets
This commit is contained in:
25
tldr/linux/ip-route-add
Normal file
25
tldr/linux/ip-route-add
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ip route
|
||||
|
||||
> Add a new networking route.
|
||||
> More information: <https://manned.org/ip-route>.
|
||||
|
||||
- Add a default route using gateway forwarding:
|
||||
|
||||
`sudo ip {{[r|route]}} {{[a|add]}} default via {{gateway_ip}}`
|
||||
|
||||
- Add a default route using `eth0`:
|
||||
|
||||
`sudo ip {{[r|route]}} {{[a|add]}} default dev {{eth0}}`
|
||||
|
||||
- Add a static route:
|
||||
|
||||
`sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} via {{gateway_ip}} dev {{eth0}}`
|
||||
|
||||
- Add a route to a specific routing table:
|
||||
|
||||
`sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} dev {{eth0}} {{[t|table]}} {{ip}}`
|
||||
Reference in New Issue
Block a user