如何查找直连设备的ip地址(DHCP) [英] How can I find ip adresses of directly connected devices (DHCP)

查看:1403
本文介绍了如何查找直连设备的ip地址(DHCP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要帮助。

如何找到直接连接到我的电脑以太网适配器(DHCP)的设备的IP地址





我尝试过:



使用UDP进行异步回调和事件的小型DHCP服务器 [ ^ ]

推荐答案

你应该在这里问一下添加评论或问题 [ ^ ],这样文章 [ ^ ]收到通知并回复您的post。
You should ask here Add a Comment or Question[^], so that the author of the article [^] gets notified and replies for your post.


当使用DHCP服务器进行网段时,会知道所有系统实际存在或不久前已经存在(当客户端不会被通知关闭)。



但是你只能拥有一台DHCP服务器。如果您想了解DHCP分配的IP地址,您必须向服务器添加此类功能(例如,通过实现请求方法)或检查服务器生成的日志文件。



在常见的网络设置中,DHCP服务器通常在网关系统(路由器)或其他本地服务器上运行。然后就不可能查询包含分配的IP地址的内部表。



没有绝对的relibale方法来获取本地网络中所有系统的IP地址。一个问题是,当检测到来自系统的某些活动时,它可能同时被关闭。另一个问题是检测所有系统。



有一些方法可以使用:



< b> ARP (地址解析协议 - 维基百科 [ ^ ])。



你可以使用 arp 命令行实用程序显示ARP表(使用 arp - ?显示可用选项):

When using a DHCP server for a network segment, that will know about all systems that are actually present or have been present a short time ago (it will not be informed when a client shuts down).

But you can have only one DHCP server. If you want to know about the IP addresses assigned by DHCP, you have to add such functionality to the server (e.g. by implementing a request method) or check the log files generated by the server.

In a common network setup, the DHCP server is usually running on the gateway system (router) or another local server. Then it is impossible to query his internal table which holds the assigned IP addresses.

There is no absolute relibale method to get the IP addresses of all systems in a local network. One problem is that when some activity from a system has been detected, it might have been switched off meanwhile. The other problem is detecting all systems.

There are some methods that might be used:

ARP (Address Resolution Protocol - Wikipedia[^]).

You can use the arp command line utility to show the ARP table (use arp -? to show the available options):
arp -a



or

arp -av

后者也会显示旧的(无效) IP地址。通过使用API​​函数,WMI或解析实用程序的输出来读取ARP表,应用程序可以实现功能。

问题:

仅查找与之通信的系统系统运行 arp 命令。



网络状态

这可以是用于获取所有当前连接的IP地址。必须为本地地址过滤输出。请参阅 Netstat [ ^ ]命令行实用程序。也可以使用WMI或API调用来获取信息。

问题:

只有活动连接。系统或其他用户拥有的连接需要系统权限。



数据包嗅探

使用数据包嗅探器使用混杂模式检查网络接口上的所有数据包。

问题:

使用网络交换机时看不到所有数据包(其他系统的数据包可能无法转发到交换机接口)。



端口扫描

尝试连接到特定端口和/或ping关于所有可能的IP地址。

问题:

并非所有系统都可能响应(没有服务在已用端口上运行,请求被过滤)。



DNS查询

如果您的本地网络运行了DNS服务器,则可以查询所有可能的IP地址。当DNS服务器被DHCP服务器提供时(与大多数SOHO路由器一样),这尤其有用。

问题:

返回所有系统的地址,即使是那些系统的地址也是如此。不起来或不再存在。

The latter will also show old (invalid) IP addresses. Functionality can be implemented by applications by reading the ARP table using API functions, WMI, or parsing the output of the utility.
Problems:
Finds only systems that has communicated with the system running the arp command.

Network Status
This can be used to get the IP adresses of all current connections. The output has to be filtered for local addresses. See the Netstat[^] command line utility. May also use WMI or API calls to get the information.
Problems:
Only active connections. Requires system privileges for connections owned by the system or other users.

Packet sniffing
Use a packet sniffer to inspect all packets on a network interface using promiscuous mode.
Problems:
Will not see all packets when using a network switch (packets to other systems might not be forwarded to the interface by the switch).

Port scanning
Try to connect to specific ports and / or ping on all possible IP adresses.
Problems:
Not all systems might respond (no services running on used ports, requests are filtered).

DNS Queries
If you have a DNS server running for your local network, you can query that for all possible IP addresses. This is especially useful when the DNS server is feeded by the DHCP server (as with most SOHO routers).
Problems:
Returns addresses for all systems even for those that are not up or does not exist anymore.


这篇关于如何查找直连设备的ip地址(DHCP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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