Home·Terminal commands

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

FlagMeaning
a / addr showInterfaces and their addresses. Replaces ifconfig.
r / routeThe routing table. Replaces route.
neighThe ARP/neighbour table. Replaces arp.
link set eth0 up|downBring an interface up or down.
-brOne short line per entry, far easier to read.
route get <ip>Which interface and source address would be used for that destination.
-4 / -6Restrict the output to one address family.

Examples

ip -br a

Every interface, state and address in a compact table.

ip route get 8.8.8.8

Which route and source IP the kernel would pick.

sudo ip addr add 192.168.1.50/24 dev eth0

Add 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