LinuxCommandLibrary

ip-address

TLDR

List all addresses

$ ip address
copy
Show only active interfaces
$ ip address show up
copy
Show specific interface
$ ip address show eth0
copy
Add IP address
$ sudo ip address add 192.168.1.100/24 dev eth0
copy
Delete IP address
$ sudo ip address delete 192.168.1.100/24 dev eth0
copy
Flush addresses by scope
$ sudo ip address flush eth0 scope global
copy

SYNOPSIS

ip address [command] [OPTIONS]

DESCRIPTION

ip address manages IP addresses on network interfaces. It can display, add, delete, and flush addresses for both IPv4 and IPv6 protocols.

PARAMETERS

show [device]

Display IP addresses (default action)
add address dev device
Add an IP address to interface
delete address dev device
Remove an IP address from interface
flush device
Remove all addresses from interface
up
Filter to show only active interfaces
scope global|link|host
Filter or set address scope
label label
Set address label
broadcast address
Set broadcast address

CAVEATS

Addresses added are not persistent across reboots. Use network configuration files or NetworkManager for persistence. An interface can have multiple IP addresses.

HISTORY

ip address is part of iproute2, replacing the deprecated ifconfig command.

SEE ALSO

ip(8), ip-link(8), ip-route(8)

Copied to clipboard