免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1832 | 回复: 0
打印 上一主题 下一主题

mac to ip [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-07-23 15:55 |只看该作者 |倒序浏览
A MAC address represents the physical identifier of a network adapter, while the IP address represents a logical device address on Internet Protocol networks.
A built-in feature of IP, Address Resolution Protocol (ARP) translates IP addresses to MAC addresses. ARP was not designed to translate addresses in the other direction, however.
Answer: Computers can determine IP addresses from MAC addresses using DHCP (and formerly other protocols like RARP and InARP).
There is no universal mechanism for an end user to determine an IP address given a known MAC address, although it can be done in certain specific situations.
1.ARP Cache
ARP maintains a list of both IP addresses and matching MAC addresses called the ARP cache. These caches are available on individual network adapters and also on IP routers. From the cache it is possible to derive an IP address from a MAC address; however, the mechanism is limited in many respects.
On Windows and some other operating systems, the "arp" command provides access to the local ARP cache. In Windows, for example, typing "arp -a" at the command (DOS) prompt will display all of the entries in that computer's ARP cache. Depending on how that local network is configured, however, this cache will often remain empty. At best, a client device's ARP cache only contains entries for other computers on the LAN.
one way to use arp to obtain mac, is to ping the whole lan (broadcast) first then arp | grep mac;
Most home broadband routers allow viewing of their ARP caches through their Web-based administrative interface. This feature reveals both IP and MAC addresses for every device currently joined to the home network. Note that in general, routers will not maintain IP-to-MAC address mappings for devices on other networks. Entries for these remote devices may appear in the ARP list, but in those cases, the MAC address shown will normally correspond to a remote LAN router, not to the device actually located at that logical address.
2.Network Management Software
Some corporate networks solve the problem of universal MAC-to-IP address mapping by installing special management software agents on all computers. These software systems, based on Simple Network Management Protocol (SNMP), include a capability called network discovery. These systems forward messages out to the agent on every network device a request for both the IP and MAC addresses of that device. The system receives then stores the results in a master table separate from any individual ARP cache.
these softwares are: nbtscan, sniffer,solarwinds, and so on;
With Internet Protocol, network discovery is often implemented using ping commands and Internet Control Message Protocol (ICMP) messages. Pinging a remote device from any client will trigger an ARP cache update. Typically this update occurs only in the ARP cache of the LAN routers and not on the originating client, however.
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/38576/showart_1089865.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP