Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Linux and Unix
Tag Cloud
access audio black screen blue screen boot bsod connection crash dell desktop driver drivers dvd email error excel excel 2003 firefox hard drive hardware hdmi hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem recovery router screen slow sound spyware tdlwsp.dll trojan upgrade video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Solved: Find connecting IP address in Linux

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
AGCurry's Avatar
Senior Member with 431 posts.
 
Join Date: Jun 2005
Location: Kansas City area
Experience: advanced but learning
10-Oct-2005, 10:45 AM #1
Solved: Find connecting IP address in Linux
I know that Linux knows and keeps track of the IP address from which I've logged in, because it tells me when I log in what address I came in from LAST.

But - is there a command which simply provides my current IP address?

Thanks in advance.
Squashman's Avatar
Distinguished Member with 14,983 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
10-Oct-2005, 11:14 AM #2
ifconfig
AGCurry's Avatar
Senior Member with 431 posts.
 
Join Date: Jun 2005
Location: Kansas City area
Experience: advanced but learning
10-Oct-2005, 11:22 AM #3
Thanks, Squashman, but ifconfig only gives me the address of the ethernet adaptor and the loopback address - and the man page for ifconfig does not seem to provide for any option to get the address of THE DEVICE FROM WHICH I AM CONNECTING.
Squashman's Avatar
Distinguished Member with 14,983 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
10-Oct-2005, 11:26 AM #4
I am not sure which device you want. If you are behind a router, look at your router config to get your Internet IP address. Or just go to http://www.whatismyip.com
AGCurry's Avatar
Senior Member with 431 posts.
 
Join Date: Jun 2005
Location: Kansas City area
Experience: advanced but learning
10-Oct-2005, 11:32 AM #5
Okay. The Linux box's network card is 172.xx.xx.xx. ifconfig gives me that address just fine.

But I'm connecting from a PC, address 10.0.xx.xx. THAT's the address I want to be able to access in a shell script. When I log on to the Linux box, there's a last-login message like "last login Tue Dec 8 blah blah from 10.0.xx.xx", so I know the information exists SOMEWHERE on the Linux server. There oughta be a command which yields it - or a file to look in, at least - but I don't know what it is.
Squashman's Avatar
Distinguished Member with 14,983 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
10-Oct-2005, 11:39 AM #6
last or lastlog
Squashman's Avatar
Distinguished Member with 14,983 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: IIAHYAYCESA,YAADA!
10-Oct-2005, 11:41 AM #7
Or just type who
AGCurry's Avatar
Senior Member with 431 posts.
 
Join Date: Jun 2005
Location: Kansas City area
Experience: advanced but learning
10-Oct-2005, 12:16 PM #8
Quote:
Originally Posted by Squashman
Or just type who
Thanks! I will extract the ip address by looking for $(tty) in the list who brings back.
Closed Thread Bookmark and Share

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 12:29 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.