1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-23 01:15:24 +02:00

ip*: add more shortforms (#15890)

This commit is contained in:
Managor 2025-03-09 14:01:49 +02:00 committed by GitHub
parent 9491618133
commit 10209c9cc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 46 additions and 46 deletions

View file

@ -9,20 +9,20 @@
- Filter to show only active network interfaces:
`ip {{[a|address]}} show up`
`ip {{[a|address]}} {{[s|show]}} up`
- Display information about a specific network interface:
`ip {{[a|address]}} show dev {{eth0}}`
`ip {{[a|address]}} {{[s|show]}} {{eth0}}`
- Add an IP address to a network interface:
`ip {{[a|address]}} add {{ip_address}} dev {{eth0}}`
`sudo ip {{[a|address]}} {{[a|add]}} {{ip_address}} dev {{eth0}}`
- Remove an IP address from a network interface:
`ip {{[a|address]}} delete {{ip_address}} dev {{eth0}}`
`sudo ip {{[a|address]}} {{[d|delete]}} {{ip_address}} dev {{eth0}}`
- Delete all IP addresses in a given scope from a network interface:
`ip {{[a|address]}} flush dev {{eth0}} scope {{global|host|link}}`
`sudo ip {{[a|address]}} {{[f|flush]}} {{eth0}} scope {{global|host|link}}`

View file

@ -9,20 +9,20 @@
- Show information about a specific network interface:
`ip {{[l|link]}} show {{ethN}}`
`ip {{[l|link]}} {{[sh|show]}} {{ethN}}`
- Bring a network interface up or down:
`ip {{[l|link]}} set {{ethN}} {{up|down}}`
`sudo ip {{[l|link]}} {{[s|set]}} {{ethN}} {{up|down}}`
- Give a meaningful name to a network interface:
`ip {{[l|link]}} set {{ethN}} alias "{{LAN Interface}}"`
`sudo ip {{[l|link]}} {{[s|set]}} {{ethN}} {{[al|alias]}} "{{LAN Interface}}"`
- Change the MAC address of a network interface:
`ip {{[l|link]}} set {{ethN}} address {{ff:ff:ff:ff:ff:ff}}`
`sudo ip {{[l|link]}} {{[s|set]}} {{ethN}} {{[a|address]}} {{ff:ff:ff:ff:ff:ff}}`
- Change the MTU size for a network interface to use jumbo frames:
`ip {{[l|link]}} set {{ethN}} mtu {{9000}}`
`sudo ip {{[l|link]}} {{[s|set]}} {{ethN}} mtu {{9000}}`

View file

@ -9,12 +9,12 @@
- List device specific addresses:
`ip {{[m|maddress]}} show dev {{eth0}}`
`ip {{[m|maddress]}} {{[s|show]}} dev {{eth0}}`
- Join a multicast group statically:
`sudo ip {{[m|maddress]}} add {{33:33:00:00:00:02}} dev {{eth0}}`
`sudo ip {{[m|maddress]}} {{[a|add]}} {{33:33:00:00:00:02}} dev {{eth0}}`
- Leave a static multicast group:
`sudo ip {{[m|maddress]}} delete {{33:33:00:00:00:02}} dev {{eth0}}`
`sudo ip {{[m|maddress]}} {{[d|delete]}} {{33:33:00:00:00:02}} dev {{eth0}}`

View file

@ -9,11 +9,11 @@
- Remove entries in the neighbour table on device `eth0`:
`sudo ip {{[n|neighbour]}} flush dev {{eth0}}`
`sudo ip {{[n|neighbour]}} {{[f|flush]}} dev {{eth0}}`
- Perform a neighbour lookup and return a neighbour entry:
`ip {{[n|neighbour]}} get {{lookup_ip}} dev {{eth0}}`
`ip {{[n|neighbour]}} {{[g|get]}} {{lookup_ip}} dev {{eth0}}`
- Add or delete an ARP entry for the neighbour IP address to `eth0`:

View file

@ -5,24 +5,24 @@
- Print route to a destination:
`ip {{[r|route]}} get {{1.1.1.1}}`
`ip {{[r|route]}} {{[g|get]}} {{1.1.1.1}}`
- Print route to a destination from a specific source address:
`ip {{[r|route]}} get {{destination}} from {{source}}`
`ip {{[r|route]}} {{[g|get]}} {{destination}} from {{source}}`
- Print route to a destination for packets arriving on a specific interface:
`ip {{[r|route]}} get {{destination}} iif {{eth0}}`
`ip {{[r|route]}} {{[g|get]}} {{destination}} iif {{eth0}}`
- Print route to a destination, forcing output through a specific interface:
`ip {{[r|route]}} get {{destination}} oif {{eth1}}`
`ip {{[r|route]}} {{[g|get]}} {{destination}} oif {{eth1}}`
- Print route to a destination with a specified Type of Service (ToS):
`ip {{[r|route]}} get {{destination}} tos {{0x10}}`
`ip {{[r|route]}} {{[g|get]}} {{destination}} tos {{0x10}}`
- Print route to a destination using a specific VRF (Virtual Routing and Forwarding) instance:
`ip {{[r|route]}} get {{destination}} vrf {{myvrf}}`
`ip {{[r|route]}} {{[g|get]}} {{destination}} vrf {{myvrf}}`

View file

@ -5,32 +5,32 @@
- Display the routing table:
`ip {{[r|route]}} show`
`ip {{[r|route]}} {{[s|show]}}`
- Display the main routing table (same as first example):
`ip {{[r|route]}} show {{main|254}}`
`ip {{[r|route]}} {{[s|show]}} {{main|254}}`
- Display the local routing table:
`ip {{[r|route]}} show table {{local|255}}`
`ip {{[r|route]}} {{[s|show]}} {{[t|table]}} {{local|255}}`
- Display all routing tables:
`ip {{[r|route]}} show table {{all|unspec|0}}`
`ip {{[r|route]}} {{[s|show]}} {{[t|table]}} {{all|unspec|0}}`
- List routes from a given device only:
`ip {{[r|route]}} show dev {{eth0}}`
`ip {{[r|route]}} {{[s|show]}} dev {{eth0}}`
- List routes within a given scope:
`ip {{[r|route]}} show scope link`
`ip {{[r|route]}} {{[s|show]}} {{[s|scope]}} link`
- Display the routing cache:
`ip {{[r|route]}} show cache`
`ip {{[r|route]}} {{[s|show]}} {{[c|cache]}}`
- Display only IPv6 or IPv4 routes:
`ip {{-6|-4}} {{[r|route]}} show`
`ip {{-6|-4}} {{[r|route]}} {{[s|show]}}`

View file

@ -5,23 +5,23 @@
- Display the routing table:
`ip {{[r|route]}} {{show|list}}`
`ip {{[r|route]}}`
- Add a default route using gateway forwarding:
`sudo ip {{[r|route]}} add default via {{gateway_ip}}`
`sudo ip {{[r|route]}} {{[a|add]}} default via {{gateway_ip}}`
- Add a default route using `eth0`:
`sudo ip {{[r|route]}} add default dev {{eth0}}`
`sudo ip {{[r|route]}} {{[a|add]}} default dev {{eth0}}`
- Add a static route:
`sudo ip {{[r|route]}} add {{destination_ip}} via {{gateway_ip}} dev {{eth0}}`
`sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} via {{gateway_ip}} dev {{eth0}}`
- Delete a static route:
`sudo ip {{[r|route]}} del {{destination_ip}} dev {{eth0}}`
`sudo ip {{[r|route]}} {{[d|delete]}} {{destination_ip}} dev {{eth0}}`
- Change or replace a static route:
@ -29,4 +29,4 @@
- Show which route will be used by the kernel to reach an IP address:
`ip {{[r|route]}} get {{destination_ip}}`
`ip {{[r|route]}} {{[g|get]}} {{destination_ip}}`

View file

@ -5,32 +5,32 @@
- Display the routing policy:
`ip {{[ru|rule]}} {{show|list}}`
`ip {{[ru|rule]}}`
- Add a new rule based on packet source addresses:
`sudo ip {{[ru|rule]}} add from {{192.168.178.2/32}}`
`sudo ip {{[ru|rule]}} {{[a|add]}} from {{192.168.178.2/32}}`
- Add a new rule based on packet destination addresses:
`sudo ip {{[ru|rule]}} add to {{192.168.178.2/32}}`
`sudo ip {{[ru|rule]}} {{[a|add]}} to {{192.168.178.2/32}}`
- Delete a rule based on packet source addresses:
`sudo ip {{[ru|rule]}} delete from {{192.168.178.2/32}}`
`sudo ip {{[ru|rule]}} {{[d|delete]}} from {{192.168.178.2/32}}`
- Delete a rule based on packet destination addresses:
`sudo ip {{[ru|rule]}} delete to {{192.168.178.2/32}}`
`sudo ip {{[ru|rule]}} {{[d|delete]}} to {{192.168.178.2/32}}`
- Flush all deleted rules:
`ip {{[ru|rule]}} flush`
`sudo ip {{[ru|rule]}} {{[f|flush]}}`
- Save all rules to a file:
`ip {{[ru|rule]}} save > {{path/to/ip_rules.dat}}`
`ip {{[ru|rule]}} {{[s|save]}} > {{path/to/ip_rules.dat}}`
- Restore all rules from a file:
`ip {{[ru|rule]}} restore < {{path/to/ip_rules.dat}}`
`sudo ip {{[ru|rule]}} {{[r|restore]}} < {{path/to/ip_rules.dat}}`

View file

@ -26,12 +26,12 @@
- Make an interface up/down:
`ip {{[l|link]}} set {{interface}} {{up|down}}`
`sudo ip {{[l|link]}} {{[s|set]}} {{interface}} {{up|down}}`
- Add/Delete an IP address to an interface:
`ip {{[a|address]}} add/del {{ip}}/{{mask}} dev {{interface}}`
`sudo ip {{[a|address]}} {{add|delete}} {{ip}}/{{mask}} dev {{interface}}`
- Add a default route:
`ip {{[r|route]}} add default via {{ip}} dev {{interface}}`
`sudo ip {{[r|route]}} {{[a|add]}} default via {{ip}} dev {{interface}}`