如何确定连接到我的计算机的IP? [英] How to determine the IP of the computer that connects to me?

查看:99
本文介绍了如何确定连接到我的计算机的IP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是场景: 在专用网络中,只有两台计算机连接到该专用网络.
假设我使用的是计算机A.计算机B随后将连接到我,并正在查看我的共享文件夹.
如果我使用的是计算机A,我怎么知道与我连接的那台计算机的IP地址? (在这种情况下,是计算机B?)

Here's the scenario: in a private network, there are only two computers connected to this private network.
Say, I am using computer A. Computer B will then connects to me and is looking at my shared folders.
If I am using computer A, how will I know the IP address of the one connecting at me? (in this case, computer B?)

请考虑两台计算机是基于UNIX的(可能是Mac OS或linux).
Unix的命令是什么? ifconfig只能显示我的IP.在我身边连接的IP列表怎么样?

please consider the two computers to be unix-based (may it be Mac OS or linux).
What will be the unix command for that? ifconfig can only show me my IP. How about the list of IPs that are connecting at me?

(附加说明:我已经在我的朋友笔记本电脑中看到了这种可能.他正在使用Conky.从那里,他可以确定连接到该笔记本电脑的数量.但是,它仅显示连接数,而不是实际连接数. IP.)

(additional note: I have seen this possible in my friends laptop. He's using Conky. And from there, he can determine how many are connected to that laptop. However, it only shows the number of connects, and not the actual IP.)

请帮助.

推荐答案

使用 netstat

netstat -l -n

您甚至可以使用-c选项查看实时"信息. -p选项可用于确定实际拥有套接字的程序.

You can even see "live" information by using the -c option. The -p option can be used to determine the program that actually owns the socket.

这篇关于如何确定连接到我的计算机的IP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆