LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 1
To find out my ip address


Hi,
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
ceantuco
Member
 
Registered: Mar 2008
Location: New Jersey
Distribution: CentOS, Debian, Kali, Ubuntu, OpenSuse
Posts: 620

Rep: Reputation: 40
Hello,

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
soplin
Member
 
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, http://www.whatismyip.com/ .
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
EDDY1
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
LlNUX
Member
 
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
mayursingru
Member
 
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
slack-fu
Member
 
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
janeesh
LQ Newbie
 
Registered: Sep 2008
Location: Bangalore
Posts: 2

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by mayursingru View Post
try this
/sbin/ip addr
the below comment is working.
Thanx..
 
1 members found this post helpful.
Old 04-07-2012, 09:52 PM   #9
plmiles
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 ifconfig.me
curl echoip.com; echo

or you can can use a browser with one of these URLs:
ifconfig.me, echoip.com, whatismyip.com, http://checkip.dyndns.com/, http://ip-me.co.uk

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
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,892
Blog Entries: 27

Rep: Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182Reputation: 2182
Member response

Hi,

Quote:
Originally Posted by slack-fu View Post
You need to have root privileges..
Not really;
Quote:
$ /sbin/ifconfig
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:16436 Metric:1
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:192.168.1.26 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21b:b1ff:fef4:209d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
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
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 258

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

Code:
#!/bin/bash

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


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:13 PM.

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