How to find IPs and IP networks behind each interface

To find the IPs of your network interfaces use ip addr show and to find the IP networks behind each interface use ip route show.

$ ip addr show

1: lo: mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
2: eth0: mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 00:08:74:22:5c:61 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0
inet 192.168.1.4/24 brd 192.168.1.255 scope global secondary eth0:1

# ip route show

192.168.52.12 dev ppp0 proto kernel scope link src 117.114.119.119
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.1
169.254.0.0/16 dev eth0 scope link metric 1000
default dev ppp0 scope link

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.