≡ Menu

Linux Find Out My IP Number ( IP Address )

How do I find out ip number (IP Address) of my Linux server using command line options?

You can use any one of the following command to find out your IP address, routing table, devices, tunnels, and much more.

[a] ip command : Display or configure ip network information.

[b] ifconfig command : Display or configure ip network information.

ip Command Example

To display ip address, enter:
$ ip addr show
Sample outputs:

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
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether b8:ac:6f:65:31:e5 brd ff:ff:ff:ff:ff:ff
3: wlan0:  mtu 1500 qdisc mq state UP qlen 1000
    link/ether 00:21:6a:bf:2d:64 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.100/24 brd 192.168.1.255 scope global wlan0
    inet6 fe80::221:6aff:febf:2d64/64 scope link
       valid_lft forever preferred_lft forever
4: virbr0:  mtu 1500 qdisc noqueue state UNKNOWN
    link/ether c2:86:1d:f6:17:a1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
    inet6 fe80::c086:1dff:fef6:17a1/64 scope link
       valid_lft forever preferred_lft forever
6: pan0:  mtu 1500 qdisc noop state DOWN
    link/ether fe:84:69:82:05:fb brd ff:ff:ff:ff:ff:ff
8: ppp0:  mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 3
    link/ppp
    inet 10.1.3.180 peer 10.0.31.18/32 scope global ppp0

To see eth0 or wlan0 interface ip info, enter:
$ ip addr show eth0
OR
$ ip addr show wlan0
To see current routing table, enter:
$ ip route show
Sample outputs:

10.0.31.18 dev ppp0  proto kernel  scope link  src 10.1.3.180
38.96.196.94 via 192.168.1.2 dev wlan0  src 192.168.1.100
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.100  metric 2
192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1
169.254.0.0/16 dev wlan0  scope link  metric 1000
10.0.0.0/8 dev ppp0  scope link
default via 192.168.1.2 dev wlan0  proto static 

To see Reply Link

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">


   Tagged with: , , , , , , , , , , , ,