如何将IP地址转换为MAC地址?
How could I convert from IP address to MAC address
我想存储所有的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地址
相关文章:
- 动态获取 esp32 的 mac 地址并在以太网库中使用它.
- 将Wiimote MAC地址转换为PIN码,从C++转换为Python或Javascript
- 读取 MAC 地址时文件读取异常
- OMNET++:如何在INET 4.0中获取帧的源MAC地址?
- 获得MAC地址的代码似乎会损坏内存,但仅在发布构建中而不是调试构建
- 如何在 Windows 中使用 C++ 获取 MAC 地址
- MAC 地址解析
- Boost Regex用于格式化MAC地址字符串
- 从Netsh WLAN获取MAC地址
- Linux C++ 如何以编程方式获取 LAN 上所有适配器的 MAC 地址
- 将格式化的 mac 地址写入字符串流
- 如何在给定设备实例ID的情况下可靠快速地获取网卡的MAC地址
- 用于in_addr结构(IPv4地址)的Mac/Windows不同格式
- 查找 DNS 服务器和网关的 IP 和 MAC 地址
- C 中的蓝牙 MAC 地址
- 正在Mac上的Xcode上尝试C++-ERROR-exc_bad_access(代码=1地址=0x100500000)
- 在字符串向量中创建20000个MAC地址
- 获取系统的唯一标识符(而不是MAC地址)
- 如何使用本机 Wifi API C++获取 MAC 地址和信道信息
- C ++如何将我的命令行参数(MAC地址)转换为无符号字符