5

How can I find the IP of my Ubuntu System in local network‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌?

1
  • 1
    See also this question for the external IP address.
    – Wilf
    Jun 25, 2014 at 8:31

4 Answers 4

6

ifconfig is and old command, that is still widely used, but if you are starting with network-related commands, you should use ip tool. ip a, which is abbreviation for ip addr is what you are looking for in this particular case.

Check ip out, it really is better than ifconfig in most cases.

4

METHOD 1: Open a terminal by pressing CTRL+ALT+T and type the following:

ifconfig

You get an output like this:

eth0      Link encap:Ethernet  HWaddr 78:84:3c:e7:0f:5a  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:5666 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5666 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1611838 (1.6 MB)  TX bytes:1611838 (1.6 MB)

mon0      Link encap:UNSPEC  HWaddr CC-AF-78-B3-E5-0F-3A-30-00-00-00-00-00-00-00-00  
          UP BROADCAST NOTRAILERS RUNNING PROMISC ALLMULTI  MTU:1500  Metric:1
          RX packets:877993 errors:0 dropped:115 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:533724526 (533.7 MB)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr cc:af:78:b3:e5:0f  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::ceaf:78ff:feb3:e50f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:377839 errors:0 dropped:0 overruns:0 frame:0
          TX packets:353884 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:460380208 (460.3 MB)  TX bytes:35093507 (35.0 MB)

As mine is wireless I can see my ip address in wlan0 . If your is a wired connection you can see it in eth0 or pppo if yours is a pppoe connection.

METHOD 2: In the top panel of Unity go to the Network Icon (Network Manager) and select Connection Information.

enter image description here You will see all the information including the IP (IPv4 and IPv6) of any device connected. In this case it is only showing one device since I have only one connected, but if I had multiple ones it would show each one on a different tab enter image description here

8
  • 1
    What an ugly first screenshot. Maybe you have different subpixel layout or whatever, but on my screen this looks quite ugly (patchy greenish-yellow text).
    – Ruslan
    Jun 25, 2014 at 11:03
  • @Ruslan yes, looks very broken somehow; And it seems to be redundant anyway? Jun 25, 2014 at 11:26
  • @VolkerSiegel yeah, the follow-up text is a more full output.
    – Ruslan
    Jun 25, 2014 at 11:28
  • It's the same output but i can't take a screenshot of the full output!
    – M.Tarun
    Jun 25, 2014 at 12:04
  • I remember that ifconfig is deprecated on Linux and serious Linux users/admins use ip addr instead.
    – Alvin Wong
    Jun 25, 2014 at 13:03
3

These other answers are great, but here's a very simple alternative that doesn't spew out a mouthful of information:

host `hostname`

hostname returns your computer's name, and host resolves a hostname to an IP address.

Alternatively, you can just do:

hostname -I

Which does (from the man page):

-I, --all-ip-addresses
Display all network addresses of the host. This option enumerates all configured addresses on all network interfaces. The loopback interface and IPv6 link-local addresses are omitted. Contrary to option -i, this option does not depend on name resolution. Do not make any assumptions about the order of the output.

2

The command you are looking for is ifconfig.

Not the answer you're looking for? Browse other questions tagged .