Linux ip Command Show IP Address/Subnet Assigned To Ethernet Interface

Fig.01 Showing IP address assigned to eth0, eth1, lo using ip command

Fig.01 Showing IP address assigned to eth0, eth1, lo using ip command

The ip command can easily display all TCP/IP address assigned to eth0, lo (loopback), vpn tunnels and much more using the following syntax:

ip addr
ip addr show
ip addr show eth0
ip addr show eth0
ip a
ip a list
ip a list eth0
ip a show dev eth0

All of the above are valid syntax for the same purpose.

Linux ip command Show Address Example

In this example, show ip address assigned to eth1:
# ip addr show eth1
Sample outputs:

3: eth1:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:08:9b:c4:30:30 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.10/24 brd 192.168.1.255 scope global eth1
    inet6 fe80::208:9bff:fec4:3030/64 scope link 
       valid_lft forever preferred_lft forever

To see details on all network interfaces, enter:
# ip a
# ip addr

See only IPv4 TCP/IP family address assigned to eth0

# ip -4 a show eth0
Sample outputs:

2: eth0:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    inet 10.10.29.68/26 brd 10.10.29.127 scope global eth0
    inet 10.8.18.23/8 brd 10.255.255.255 scope global eth0:1

See only IPv6 TCP/IP family address assigned to eth0

# ip -6 a show eth0
Sample outputs:

2: eth0:  mtu 1500 qlen 1000
    inet6 fe80::230:48ff:fe33:bc32/64 scope link 
       valid_lft forever preferred_lft forever

Examples and usage: Linux ip Command Examples