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 acer asus bios bsod computer crash dns driver drivers error ethernet excel freeze gaming google hard drive hardware hdmi internet laptop mac malware memory monitor motherboard mouse network printer problem ram registry router server slow software sound svchost.exe trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Operating Systems > Linux and Unix >
Solved: Find connecting IP address in Linux

Reply  
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, 11: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
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
10-Oct-2005, 12:14 PM #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, 12:22 PM #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
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
10-Oct-2005, 12:26 PM #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, 12:32 PM #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
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
10-Oct-2005, 12:39 PM #6
last or lastlog
Squashman's Avatar
Trusted Advisor with 18,706 posts.
 
Join Date: Apr 2003
Location: 1265 Lombardi Ave
Experience: Bocks of Rox
10-Oct-2005, 12:41 PM #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, 01: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.
Reply

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.

Search Tech Support Guy

Find the solution to your
computer problem!




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



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:25 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.