Manually scan the MAC address of the LAN)

Source: Internet
Author: User

So I first tried to search for a MAC address scanner on the Internet and scanned all the MAC addresses of the machines in the LAN. After searching for the scanner for a long time, it was either a trial version, a registration, or a bomb. Alas, now I have to charge for a broken Mac scan tool. People who like me who get used to free lunch of network resources are reluctant to pay for it. What should I do? Staring at the screen, suddenly a flash of light, thought of a command:ARPRight. Use ARP cache information to get the MAC address of the LAN machine I want. Haha, let's take a look at the train of thought and start-up operations. Haha, even some machines that cannot be scanned by some trial and cracked Mac scanning tools have ARP information, which is great. Now, let's talk about my ideas and operations. I hope you can leave more comments and give more valuable comments ~~~

Ideas:Run the ping command to ping the IP address of the machine in the LAN first, because I want to obtain the desired MAC address in the ARP cache information of the local machine. The ARP cache of the local machine records the IP address and MAC address of the machine that has been pinged. That is to say, the local machine sends a packet, the target machine will have a response containing the IP address and MAC address, which will be cached in the Local Machine's ARP cache. On the local machine, ARP-A is used to display all the data. (The firewall or packet filtering method cannot prohibit ARP viewing. The remote computer does not return a successful Ping message but will tell the local computer the MAC address corresponding to this IP address. Some Mac scanning tools cannot obtain the IP address and Mac information of the other party due to the firewall of the other party .)

Operation:With these ideas, it is almost the same. But I cannot ping the machine one by one, so I write a batch to check online machines in the LAN in batches. For example, you need to check which addresses in 192.168.0. * are online. Right-click a text file on the desktop and enter the followingCode:

For/L % I in (0,1, 255) Do ping 192.168.0.% I-n 1
ARP-a-> mac.txt

In the hosts file (ARP-a-> mac.txt indicates to save the ARP display result to the mac.txt text file. If you only want to ping a part of the IP address instead of all the IP addresses in the CIDR block, in (255, 1,255) of in () in the preceding command line, the value indicates the range of IP addresses. Note: NoProgramThe error reporting function. Therefore, the IP address range should be strictly between 1,255 to prevent exceptions when the machine executes batch processing.^_^ ). For example, I only want to scan the IP and Mac information between 192.168.0.10 and 192.168.0.200. You can write the following:

For/L % I in (0,10, 200) Do ping 192.168.0.% I-n 1
ARP-a-> mac.txt

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.