-6

我想存储可以访问我的服务器的所有 MAC 地址。我所知道的只是IP地址。所有机器都在唯一的网关下。我可以从他们的 IP 地址中获取 MAC 地址吗?

4

5 回答 5

7

MAC 地址不是任何路由协议的一部分,您永远不会获得位于路由器或交换机另一端的机器的 MAC 地址。

它们是物理端口的地址,而不是机器的地址(这是您使用 IP 的目的)。

于 2013-05-15T06:55:51.747 回答
3

简单的答案是,不,除非两台机器都在同一个物理网络上,否则您无法从连接到服务器的客户端的 IP 地址获取 MAC 地址

于 2013-05-15T06:55:16.497 回答
3

如果服务器和客户端在同一网络上,则必须使用ARP。该协议旨在将 MAC 地址获取到给定的 IP 地址。

一旦客户端和服务器之间存在路由器之类的东西,ARP 只会显示路由器的 MAC 地址,因为这是您的以太网数据包的目标。

于 2013-05-15T06:59:37.363 回答
0

无法从 IP 地址获取 MAC 地址。MAC地址是网络设备的物理地址,IP地址不是。

IP 地址通常不绑定到一台设备。

于 2013-05-15T06:55:30.317 回答
0

我建议你通过这个

帖子说

   An IP address is usually assigned by the network administrator or internet 
service provider, you are either provided a static one at the beginning or 
given a dynamic one every time you connect to the network. 
      This is not true with MAC addresses as it is already embedded on the device 
or the network card during manufacturing. It is supposed to be permanent and could 
 not be changed by anyone as it was meant to identify a specific network interface 
card no matter where it is in the world.

但是有一些方法可以更改mac地址,但我认为不可能使用IP地址获取mac地址

于 2013-05-15T07:06:20.583 回答