【问题标题】:MAC address to IP conversionMAC地址到IP的转换
【发布时间】:2011-09-28 05:52:01
【问题描述】:

虽然有很多关于 IP 到 MAC 地址转换的教程,但可用于反向过程的教程并不多。我已经检查了 RARP(这只是协议)。有没有MAC到IP转换的方法。谢谢!

【问题讨论】:

  • 你到底想做什么,在什么平台上?
  • 你想通过IP获取远程系统的MAC地址吗?或者您想访问您的 NIC 适配器以获取所有 MAC?
  • 很抱歉没有提供更多信息。我需要找到在主机上运行的虚拟机的 IP。我有他们的 MAC 地址,但没有他们的 IP。我使用 KVM 作为我的管理程序。使用 ifconfig,我可以从 vnet 获取 VM 的 MAC 地址,但不能获取 IP。

标签: java mac-address ipv4


【解决方案1】:

在 Linux 上,您可以使用 arp 命令获取此类信息:

$ sudo arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.1.5              ether   01:00:00:11:44:11   C                     eth0
192.168.1.6              ether   02:00:00:44:33:22   C                     eth0

【讨论】:

    【解决方案2】:

    我已经准确解决了您的问题,让我解释一下您需要的一切,例如如何将 MAC 地址转换为 IP 地址或MAC to IPv4 IPv6 IP 地址? MAC地址是什么? mac地址是48位,IPv6地址是128位。

    Here is the MAC to IP address conversion process step by step:
    take the mac address: for example 52:74:f2:b1:a8:7f.
    throw ff:fe in the middle: 52:74:f2:ff:fe:b1:a8:7f.
    reformat to IPv6 notation 5274:f2ff:feb1:a87f.
    convert the first octet from hexadecimal to binary: 52 -> 01010010.
    invert the bit at index 6 (counting from 0): 01010010 -> 01010000.
    convert octet back to hexadecimal: 01010000 -> 50.
    replace first octet with newly calculated one: 5074:f2ff:feb1:a87f.
    prepend the link-local prefix: fe80::5074:f2ff:feb1:a87f.
    

    MAC 地址转换工具的工作原理是什么? 您也可以使用完美的MAC address converter 可以将任何MAC 地址转换为IPv4 internet protocol address rangesIPV6 internet protocol address ranges。它将 MAC 地址作为输入字符串,并针对给定的 MAC 地址和转换选项生成查询,例如转换为IPv6 to IPv4 或两者,然后执行上述步骤。查询根据选定的选项生成输出响应。如果提供的 MAC 地址无效或无法转换,工具也会生成无效的输入消息响应。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-09
      • 2014-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-29
      • 1970-01-01
      相关资源
      最近更新 更多