1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-09 09:15:47 +02:00

ip*: unify network interface notation (#16930)

This commit is contained in:
Managor 2025-06-24 16:05:46 +03:00 committed by GitHub
parent 426aac5cd2
commit 759f8187b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 35 additions and 35 deletions

View file

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

View file

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

View file

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

View file

@ -7,18 +7,18 @@
`ip {{[n|neighbour]}}`
- Remove entries in the neighbour table on device `eth0`:
- Remove entries in the neighbour table on device `ethX`:
`sudo ip {{[n|neighbour]}} {{[f|flush]}} dev {{eth0}}`
`sudo ip {{[n|neighbour]}} {{[f|flush]}} dev {{ethX}}`
- Perform a neighbour lookup and return a neighbour entry:
`ip {{[n|neighbour]}} {{[g|get]}} {{lookup_ip}} dev {{eth0}}`
`ip {{[n|neighbour]}} {{[g|get]}} {{lookup_ip}} dev {{ethX}}`
- Add or delete an ARP entry for the neighbour IP address to `eth0`:
- Add or delete an ARP entry for the neighbour IP address to `ethX`:
`sudo ip {{[n|neighbour]}} {{add|delete}} {{ip_address}} lladdr {{mac_address}} dev {{eth0}} nud reachable`
`sudo ip {{[n|neighbour]}} {{add|delete}} {{ip_address}} lladdr {{mac_address}} dev {{ethX}} nud reachable`
- Change or replace an ARP entry for the neighbour IP address to `eth0`:
- Change or replace an ARP entry for the neighbour IP address to `ethX`:
`sudo ip {{[n|neighbour]}} {{change|replace}} {{ip_address}} lladdr {{new_mac_address}} dev {{eth0}}`
`sudo ip {{[n|neighbour]}} {{change|replace}} {{ip_address}} lladdr {{new_mac_address}} dev {{ethX}}`

View file

@ -7,14 +7,14 @@
`sudo ip {{[r|route]}} {{[a|add]}} default via {{gateway_ip}}`
- Add a default route using `eth0`:
- Add a default route using `ethX`:
`sudo ip {{[r|route]}} {{[a|add]}} default dev {{eth0}}`
`sudo ip {{[r|route]}} {{[a|add]}} default dev {{ethX}}`
- Add a static route:
`sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} via {{gateway_ip}} dev {{eth0}}`
`sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} via {{gateway_ip}} dev {{ethX}}`
- Add a route to a specific routing table:
`sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} dev {{eth0}} {{[t|table]}} {{ip}}`
`sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} dev {{ethX}} {{[t|table]}} {{ip}}`

View file

@ -13,11 +13,11 @@
- Print route to a destination for packets arriving on a specific interface:
`ip {{[r|route]}} {{[g|get]}} {{destination}} iif {{eth0}}`
`ip {{[r|route]}} {{[g|get]}} {{destination}} iif {{ethX}}`
- Print route to a destination, forcing output through a specific interface:
`ip {{[r|route]}} {{[g|get]}} {{destination}} oif {{eth1}}`
`ip {{[r|route]}} {{[g|get]}} {{destination}} oif {{ethX}}`
- Print route to a destination with a specified Type of Service (ToS):

View file

@ -21,7 +21,7 @@
- List routes from a given device only:
`ip {{[r|route]}} {{[l|list]}} dev {{eth0}}`
`ip {{[r|route]}} {{[l|list]}} dev {{ethX}}`
- List routes within a given scope:

View file

@ -11,21 +11,21 @@
`sudo ip {{[r|route]}} {{[a|add]}} default via {{gateway_ip}}`
- Add a default route using `eth0`:
- Add a default route using `ethX`:
`sudo ip {{[r|route]}} {{[a|add]}} default dev {{eth0}}`
`sudo ip {{[r|route]}} {{[a|add]}} default dev {{ethX}}`
- Add a static route:
`sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} via {{gateway_ip}} dev {{eth0}}`
`sudo ip {{[r|route]}} {{[a|add]}} {{destination_ip}} via {{gateway_ip}} dev {{ethX}}`
- Delete a static route:
`sudo ip {{[r|route]}} {{[d|delete]}} {{destination_ip}} dev {{eth0}}`
`sudo ip {{[r|route]}} {{[d|delete]}} {{destination_ip}} dev {{ethX}}`
- Change or replace a static route:
`sudo ip {{[r|route]}} {{change|replace}} {{destination_ip}} via {{gateway_ip}} dev {{eth0}}`
`sudo ip {{[r|route]}} {{change|replace}} {{destination_ip}} via {{gateway_ip}} dev {{ethX}}`
- Show which route will be used by the kernel to reach an IP address:

View file

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