如何在网络(VPN 或 LAN)中查找连接的主机
我正在寻找满足以下需求的可能解决方案:
我配置了一个VPN(顺便说一句,在Linux上使用openVPN),并且我想随时知道哪些主机连接到它。 我认识到这可能与尝试知道哪些主机连接到 LAN 是一样的,因此任何解决方案都可以完成这项工作...
事实是,我曾经在 Linux 上使用过 hamachi vpn,并且用它我有有机会知道哪些主机连接到我所属的特定网络,所以我想知道在 openVPN(甚至任何 VPN 和/或任何 LAN)中是否可能有类似的东西。
最好是,我正在寻找开源/免费软件解决方案,或者可能是自己编程的提示(如果可能的话,以最简单的方式,不是我不知道如何编程,而是我试图在一种简单的方式)。 但无论如何,如果没有 os/fsw 解决方案,任何其他解决方案都可以......
非常感谢!
哈维尔, 墨西哥城
I'm looking for possible solutions to the following need:
I have a VPN configured (using openVPN over Linux, BTW), and I want to know at any moment which hosts are connected to it. I recognize that it probably is the same thing as trying to know which hosts are connected to a lan, so any of the solutions might do the job...
The fact is that I once used a hamachi vpn on linux and with it I had the chance to know which hosts were connected to a particular network where I belonged, so I was wondering if something similar might be possible in openVPN (or even any VPN and/or any LAN).
Preferably, I'm looking for opensource/free sw solutions, or maybe the hints to program it myself (in the most simple way if possible, not that I don't know how to program, but I'm trying to achieve this in a simple manner). But anyway, if there are no os/fsw solutions, any other one might do...
Thanks a lot!
Javier,
Mexico city
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Linux 中使用 OpenVPN 实现此目的的一个简单方法是在服务器端使用
client-connect
和client-disconnect
脚本来为您维护一个列表。 每次客户端连接时,client-connect
脚本可以记录$common_name
环境变量(如果您愿意,还可以记录它的$trusted_ip
),client-disconnect
脚本可以从列表中删除该客户端。如果您还将连接和断开连接写入不同的时间戳日志,则您将拥有每个连接的时间和持续时间的永久记录。
An easy way to do this with OpenVPN in linux is to use the
client-connect
andclient-disconnect
scripts on the server end to maintain a list for you. Theclient-connect
script can log the$common_name
environment variable (and also its$trusted_ip
, if you like) each time a client connects, and theclient-disconnect
script can remove that client from the list.If you also write both connections and disconnections to a different time-stamped log, you'll have a permanent record of the time and duration of each connection.