ip
Networking
Usage
ip <object> <command>The single Linux command for addresses, routes and the neighbour table, replacing ifconfig, route and arp; anything you change with it is gone after a reboot unless you also write it into the network configuration.
Common flags
| Flag | Meaning |
|---|---|
| a / addr show | Interfaces and their addresses. Replaces ifconfig. |
| r / route | The routing table. Replaces route. |
| neigh | The ARP/neighbour table. Replaces arp. |
| link set eth0 up|down | Bring an interface up or down. |
| -br | One short line per entry, far easier to read. |
| route get <ip> | Which interface and source address would be used for that destination. |
| -4 / -6 | Restrict the output to one address family. |
Examples
ip -br aEvery interface, state and address in a compact table.
ip route get 8.8.8.8Which route and source IP the kernel would pick.
sudo ip addr add 192.168.1.50/24 dev eth0Add an address, live and temporary.
When a connection fails, these narrow down how far it got — name not resolving, no route, or a blocked port.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does ip do?
The single Linux command for addresses, routes and the neighbour table, replacing ifconfig, route and arp; anything you change with it is gone after a reboot unless you also write it into the network configuration.
Q. How do I type it?
ip <object> <command> — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
7 are listed here; the full set is in man ip. This command sits under Networking.
Related commands
man page: man ip