How to show IP addresses with ip address

Showing current IP addresses with ip address confirms which interfaces are present, which IPv4 or IPv6 prefixes are active, and whether a host currently owns the address that a route, firewall rule, or listening service expects.

The ip address command reads the kernel's live network state and displays interface flags, link-layer details, address families, prefix lengths, scopes, and lifetime data in one place. The same command can also filter by interface name, address family, or link state without switching to a different tool.

Read-only address queries usually do not need elevated privileges, but the output can vary across physical hosts, virtual machines, containers, and network namespaces. Virtual interfaces may include peer markers such as eth0@if395, and loopback commonly reports state UNKNOWN even when it is working normally.

Steps to show IP addresses with ip address:

  1. Show the full address table with the standard detailed view.
    $ ip address show
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
    ##### snipped #####
    11: eth0@if395: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 65535 qdisc noqueue state UP group default
        link/ether 9e:23:53:7e:c6:51 brd ff:ff:ff:ff:ff:ff link-netnsid 0
        inet 172.17.0.3/16 brd 172.17.255.255 scope global eth0
           valid_lft forever preferred_lft forever

    The detailed view includes interface flags, address scope, and valid or preferred lifetime fields that the brief view omits.

  2. Use the brief format for a faster summary of interface state and assigned addresses.
    $ ip -brief address show
    lo               UNKNOWN        127.0.0.1/8 ::1/128
    tunl0@NONE       DOWN
    ##### snipped #####
    eth0@if395       UP             172.17.0.3/16

    The brief form is useful when the goal is simply to confirm whether an interface is up and which addresses are currently attached.

  3. Restrict the output to one address family when diagnosing only IPv4 or only IPv6.
    $ ip -4 address show
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
    11: eth0@if395: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 65535 qdisc noqueue state UP group default  link-netnsid 0
        inet 172.17.0.3/16 brd 172.17.255.255 scope global eth0
           valid_lft forever preferred_lft forever
    
    $ ip -6 address show
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever

    Use -4 to hide IPv6 lines and -6 to hide IPv4 lines when only one family matters.

  4. Limit the query to one interface when a single device is under investigation.
    $ ip address show dev eth0
    11: eth0@if395: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 65535 qdisc noqueue state UP group default
        link/ether 9e:23:53:7e:c6:51 brd ff:ff:ff:ff:ff:ff link-netnsid 0
        inet 172.17.0.3/16 brd 172.17.255.255 scope global eth0
           valid_lft forever preferred_lft forever

    Replace eth0 with the actual interface name shown on the host, such as ens3, enp1s0, or a VLAN device.

  5. Show only interfaces that are currently marked up when inactive tunnel or placeholder devices make the full list noisy.
    $ ip address show up
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
    ##### snipped #####
    11: eth0@if395: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 65535 qdisc noqueue state UP group default
        link/ether 9e:23:53:7e:c6:51 brd ff:ff:ff:ff:ff:ff link-netnsid 0
        inet 172.17.0.3/16 brd 172.17.255.255 scope global eth0
           valid_lft forever preferred_lft forever

    The up filter keeps the output focused on loopback and interfaces that are currently active.