tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* Summary: How do you determine the IP address you connected with?
@ 1999-06-08 14:42 Edward Nowlan
  0 siblings, 0 replies; only message in thread
From: Edward Nowlan @ 1999-06-08 14:42 UTC (permalink / raw)
  To: tru64-unix-managers

I received quite a few response, rather quickly, thanks to:

George Gallen <ggallen@slackinc.com>
"C.Ruhnke" <i769646@smrs013a.mdc.com>
"David J. DeWolfe" <sxdjd@java.sois.alaska.edu>
Amy Skowronek <amy@aloha.nascom.nasa.gov>
Gwen Pettigrew <gwen@itg.cam.ac.uk>
Sean O'Connell <sean@stat.Duke.EDU>
Paul A Sand <pas@unh.edu>
Rob Mayfield <Rob.Mayfield@digital.com>
Wayne Sweatt <sweatt@dps.state.nm.us>

I choose to use the following to get the IP address and used arp ip-address to
get the ethernet address. I am lucky that we are a flat network, no subnets so
I can arp for my address, otherwise arp would return the router's address:

who -Mm | awk '{print $6}' | sed s/\(// | sed s/\)//


Other responses included:
------------------------------------------------------------------

TTY=`tty | cut -b 9-`
HOSTNAME="`w | grep $TTY | paste -s - | awk '{print $3}'`"

------------------------------------------------------------------

lsof   (No specifics were given and as of yet I have not tried this one)

------------------------------------------------------------------

mytty=`tty | sed -e 's/\/dev\///' `
REMOTEHOST=`who -M | grep ${mytty} | awk -F \( '{ print $2 }' | sed -e 's/)//'`

If using ssh environment variable SSH_CLIENT (IP Address) and SSH_TTY (tty)

------------------------------------------------------------------

If you have tcsh then the environment variable REMOTEHOST


------------------------------------------------------------------

who -M | awk '{print $6}' | tr -d '[()]'

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-06-08 14:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-06-08 14:42 Summary: How do you determine the IP address you connected with? Edward Nowlan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox