Command library / ip
ip
Show network interfaces, addresses and routes
The modern replacement for ifconfig, route and arp on Linux. The first word after ip is the object you're asking about: addr (the host's IP addresses), route (where traffic goes, including the default gateway) or neigh (the neighbour, or ARP, table). Each object has a short form: a, r, n. ip's own options, such as -br, go before the object.
Practice ipUsage
Options and flags
objectwhat to show: addr, route, neigh or link
-br, -briefone compact line per interface
-4IPv4 only
-6IPv6 only
Examples
ip addrEvery interface with its IP addresses.
ip routeThe routing table; the line starting with default is the gateway.
ip -br addrOne compact line per interface: name, state, addresses.
ip route get 8.8.8.8Which interface and gateway would be used to reach 8.8.8.8.
ip neighThe neighbour (ARP) table: which MAC address answered for which IP.
Common mistakes
The object is address, addr or just a; a misspelling such as adress is rejected.