ip-addr(8)
Show and manipulate IP addresses on network interfaces.
Synopsis
ip addr [ add | del | flush | replace | show ] ADDRESS dev IFNAMEDescription
The ip addr command is part of the iproute2 suite and manages IPv4 and IPv6 addresses on network interfaces. It displays current address configuration and allows adding, removing, or modifying addresses without restarting networking services.
Address changes made with ip addr are temporary and will be lost on reboot unless made permanent through network configuration files (e.g., /etc/network/interfaces or NetworkManager).
Common options
| Flag | What it does |
|---|---|
add | Add a new address to an interface |
del | Remove an address from an interface |
show | Display all addresses (default action if no command given) |
flush | Remove all addresses from an interface or matching criteria |
-4 | Show only IPv4 addresses |
-6 | Show only IPv6 addresses |
dev IFNAME | Specify network interface to operate on |
broadcast | Set broadcast address when adding an address |
label LABEL | Set interface alias when adding an address |
scope | Set scope (global, link, host) for the address |
Examples
Display all IP addresses on all interfaces with detailed information
ip addr showShow only addresses configured on the eth0 interface
ip addr show dev eth0Add the IP address 192.168.1.100 with netmask /24 to eth0
ip addr add 192.168.1.100/24 dev eth0Add a secondary address to eth0 with interface alias eth0:1
ip addr add 192.168.1.101/24 dev eth0 label eth0:1Remove the IP address 192.168.1.100 from eth0
ip addr del 192.168.1.100/24 dev eth0Display only IPv4 addresses across all interfaces
ip -4 addr showRemove all addresses from the eth0 interface
ip addr flush dev eth0Show only globally-scoped addresses on all interfaces
ip addr show scope global