2014-02-25 02:25:47 +00:00
|
|
|
# ip
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Show / manipulate routing, devices, policy routing and tunnels.
|
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
|
|
|
|
|
|
|
`ip a`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Display the routing table:
|
2014-02-25 02:25:47 +00:00
|
|
|
|
|
|
|
`ip r`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Make an interface up/down:
|
2014-02-25 02:25:47 +00:00
|
|
|
|
|
|
|
`ip link set {{interface}} up/down`
|
|
|
|
|
2016-01-07 17:31:27 +00: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}}`
|