- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Find client IP addresses that connecto UNIX se...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 03:27 AM
тАО07-21-2005 03:27 AM
I am running HP-UX 11.0 on L2000 HP9000 server. You can run who -r to get the host name of users connected to the system.
How can I get the IP address of that PC.
The server must know the host name , IP, and MAC addresses of all that are connected to it.
IS there a command that will show this information to me?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 03:33 AM
тАО07-21-2005 03:33 AM
SolutionTo get the host IP addresses you need to wrap your "who -r" command in some sort of a script .
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 03:35 AM
тАО07-21-2005 03:35 AM
Re: Find client IP addresses that connecto UNIX server.
Do not see any options for the MAC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 03:36 AM
тАО07-21-2005 03:36 AM
Re: Find client IP addresses that connecto UNIX server.
Use the 'who -RT' or 'who -um'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 03:40 AM
тАО07-21-2005 03:40 AM
Re: Find client IP addresses that connecto UNIX server.
I am trying to send a file to a client that is not resolved in DNS. I can get the host name becasue it signs in to the server, but I need the IP address.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 03:52 AM
тАО07-21-2005 03:52 AM
Re: Find client IP addresses that connecto UNIX server.
LOOKUP=`who -um | awk '{print $NF}'`
nslookup $line
The last field in the 'who -um' will be the name or IP, depending on resolution.
Do the nslookup command the the result. Be it name or IP address you will get a result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 04:13 AM
тАО07-21-2005 04:13 AM
Re: Find client IP addresses that connecto UNIX server.
(Beware, it is NOT error-proof as it is a quick hack)
who -R | while read u p m d t h
do
hh=`echo $h | cut -d"(" -f2 | cut -")" -f1`
hh1=`echo $hh -cut -c1`
case "$hh1" in
[0-9] ) hip=$hh ;;
* ) hip=`nslookup $hh|grep ^Address|cut -d: -f2|sed -e "1,1s/ //"` ;;
esac
echo $u"\t"$p"\t"$m" "$t"\t"$hip
done
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 04:21 AM
тАО07-21-2005 04:21 AM
Re: Find client IP addresses that connecto UNIX server.
who -R | while read u p m d t h
do
hh=`echo $h | cut -d"(" -f2 | cut -d")" -f1`
hh1=`echo $hh -cut -c1`
case "$hh1" in
[0-9] ) hip=$hh ;;
* ) hip=`nslookup $hh|grep ^Address|cut -d: -f2|sed -e "1,1s/ //"` ;;
esac
echo $u"\t"$p"\t"$m" "$t"\t"$hip
done
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 04:41 AM
тАО07-21-2005 04:41 AM
Re: Find client IP addresses that connecto UNIX server.
Last -R, who -u know the host names. Nestat knows the IP address, and arp knows the MAC address. There is no way to put them together without DNS?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 04:50 AM
тАО07-21-2005 04:50 AM
Re: Find client IP addresses that connecto UNIX server.
To put all together so you can get name, IP, MAC - you will need to script this. No single command to get all of this info.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 05:17 AM
тАО07-21-2005 05:17 AM
Re: Find client IP addresses that connecto UNIX server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 05:18 AM
тАО07-21-2005 05:18 AM
Re: Find client IP addresses that connecto UNIX server.
arp -a
command will give you the contents of the arp table which will include the hostname (if resolvable by nsswitch.conf/hosts/dns combination) host interface IP address and host interface MAC address in a rather uniform format. All you have to do is use the right combination of, who, grep, cut, awk, nslookup and arp commands to extract the information you need and put them to output of your choice. Wish I had enough time to help you out with the script but today is not one of those days :)
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2005 05:39 AM
тАО07-21-2005 05:39 AM