How to obtain an unused IP address

Source: Internet
Author: User
Tags requires

Local area network users sometimes need to set their own computer IP address, but sometimes do not know which addresses have not been used. Tutor System how do you view unused IP addresses.

When we troubleshoot a Windows operating system DHCP problem, we sometimes find out which addresses are not being used in an address range. Simply create a batch file that requires it to return only those unused IP addresses, and then enter the results of the command into a text file.

When we troubleshoot a Windows operating system DHCP problem, we sometimes find out which addresses are not being used in an address range. Simply create a batch file that requires it to return only those unused IP addresses, and then enter the results of the command into a text file.

As a webmaster, when we troubleshoot a Windows operating system DHCP problem, we sometimes find out which addresses are not being used in an address range. I have previously introduced a method: Open the Command Prompt window, in the for...in ... The ping command is invoked in the Do loop. For example, to find out which addresses are not being used in the address range 192.168.1.1 to 192.168.1.100, you can use this command: for/l%f in (1,1,100) do ping.exe-n 2 192.168.1.%f

This command reports all IP addresses within the specified range, whether in use or unused, and users have to look at a large amount of content in the command line window. In fact, we can avoid all this trouble simply by creating a batch file that requires it to return only those unused IP addresses and then enter the results of the command into a text file. The following methods are described:

Open Notepad and enter the following command in the window:

@Echo off

date/t > IPList.txt

time/t >> IPList.txt

echo =========== >> IPList.txt

FOR/L%%f in (1,1,100) did ping.exe-n 2 192.168.1.%%f find

"Request timed out." & Echo 192.168.1.%%f timed out >>

IPList.txt & Echo off

Cls

Echo finished!

@Echo on

Notepad.exe IPList.txt

Save this file as a iptracker.bat and close the Notepad program.

It should be noted that in this batch file, the entire for ... In ..... The Do command consists of several commands that are connected by "&&". The command starts with "for" and ends with "off", and the entire command must be on one line. Of course, if users want to use this method, they need to replace the IP address in the example with their own IP address.

Later, if the user wants to resolve DHCP problems, you can locate and double-click the Iptracker.bat file in the browser window, and then start an IP address tracking tool that finds only those unused IP addresses and saves the results to a Notepad file. (In this case, the saved batch file becomes an IP address tracking tool that can be created and reused once.) )

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.