Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-25-2011, 12:29 AM   #1
LQ Newbie
Registered: Sep 2008
Location: Bangalore
Posts: 2

Rep: Reputation: 1
To find out my ip address

i am actually connected to a computer that is connected to a LAN.
I want to find out my ip address.
i have checked 'ifconfig' its not working.
Plz let me know any other command is there
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-25-2011, 12:31 AM   #2
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 657

Rep: Reputation: 43

can you give us more information? what do you get when you type ifconfig. please paste your results here. also, what distro are you using?
Old 02-25-2011, 12:40 AM   #3
Registered: Apr 2007
Distribution: Mostly Debian
Posts: 114

Rep: Reputation: 19
ifconfig may not be accessible directly or not at all. check sh /usr/sbin/ifconfig or sh /usr/ifconfig depending on the setup. If you want the public IP address, .
Sometimes you can ls /var/log/samba and see if the ip shows up in there as a log.
hostname -i

Last edited by soplin; 02-25-2011 at 12:42 AM.
Old 02-25-2011, 01:06 AM   #4
LQ Addict
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Do you have an icon that shows that you're connected? If so then right click on it and select connection information.
Old 02-25-2011, 01:07 AM   #5
Registered: Oct 2007
Location: Sydney, Australia
Distribution: Debian
Posts: 63

Rep: Reputation: 15
You and also use perl to find you external public IP address.
Old 02-25-2011, 04:15 AM   #6
Registered: Nov 2010
Location: Pune
Distribution: CentOS
Posts: 51

Rep: Reputation: 5
try this
/sbin/ip addr
2 members found this post helpful.
Old 02-25-2011, 05:22 AM   #7
Registered: Feb 2006
Location: Norway
Distribution: Slackware Linux 13.37
Posts: 71

Rep: Reputation: 10
You need to have root privileges..
1 members found this post helpful.
Old 02-28-2011, 12:41 AM   #8
LQ Newbie
Registered: Sep 2008
Location: Bangalore
Posts: 2

Original Poster
Rep: Reputation: 1
Originally Posted by mayursingru View Post
try this
/sbin/ip addr
the below comment is working.
1 members found this post helpful.
Old 04-07-2012, 09:52 PM   #9
LQ Newbie
Registered: Oct 2005
Distribution: Slackware
Posts: 5
Blog Entries: 1

Rep: Reputation: 0
Unless you are using a 56K modem or an older DSL modem, ifconfig will tell you your LAN address, not your internet IP address.

Certain websites will return your IP address. Use one of these BASH commands:
curl; echo

or you can can use a browser with one of these URLs:,,,,

or find the LAN address of your modem or router with this BASH command:
arp -n
Type the numeric IP into your browser to get to an information page
You might need a password or modem access code, printed on the DSL modem
Old 04-08-2012, 10:35 AM   #10
Registered: Jan 2005
Location: Summer Midwest USA, Central Illinois, Winter Central Florida
Distribution: SlackwareŽ
Posts: 13,237
Blog Entries: 29

Rep: Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437Reputation: 2437
Member response


Originally Posted by slack-fu View Post
You need to have root privileges..
Not really;
$ /sbin/ifconfig
lo Link encap:Local Loopback
inet addr: Mask:
inet6 addr: ::1/128 Scope:Host
RX packets:2488 errors:0 dropped:0 overruns:0 frame:0
TX packets:2488 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:227343 (222.0 KiB) TX bytes:227343 (222.0 KiB)

wlan0 Link encap:Ethernet HWaddr 00:1b:b1:f4:20:9d
inet addr: Bcast: Mask:
inet6 addr: fe80::21b:b1ff:fef4:209d/64 Scope:Link
RX packets:6244442 errors:0 dropped:6 overruns:0 frame:0
TX packets:2638520 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5487938741 (5.1 GiB) TX bytes:309104926 (294.7 MiB)
'/sbin' is not always in the 'users' PATH. So absolute direction will work. Sure you may not be able to make system changes without 'sudo' or 'su -'.
Old 04-08-2012, 11:23 AM   #11
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 258

Rep: Reputation: 41
Originally Posted by LlNUX View Post
You and also use perl to find you external public IP address.
or bash:


wget -qO - -U Firefox/3.0.15 | grep "Your IP is" | sed 's/.*Your IP is: \(.*\)<.*>/\1/'


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find real ip address using link local address, mdns/zeroconf dannemanare Linux - Networking 0 01-17-2008 05:31 AM
how to find physical address of kernel virtual address kushneeraj Programming 0 10-20-2006 08:29 PM
How to find an IP address from the MAC address of a remote machine ? jitz Linux - General 3 01-03-2006 08:55 AM
How to find IP address of a machine if I know their MAC Address dysenteryduke Linux - Networking 13 09-12-2005 11:21 AM
How to find MAC address of a specified IP address ? longtongfish Programming 1 07-12-2005 04:26 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:14 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration