如何将IP地址转换为MAC地址?

How could I convert from IP address to MAC address

本文关键字:地址 MAC 转换 IP      更新时间:2023-10-16

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

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

它们是物理端口的地址,而不是机器的地址(这就是您使用IP与之交谈的内容)。

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

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

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

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

IP地址一般不绑定到一个设备。

我建议你仔细看一遍

文章说

   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地址,但我不认为这是可能得到mac地址使用IP地址