How to add multiple ips in batches under Windows

  
 

Method 1:

When we add IP, most of them are added one by one in the control panel, but if there are dozens or hundreds of IPs added, It’s very troublesome. Today I will talk about a way to add IP in batches under the CMD window.

First open the CMD window, start – run cmd, type netsh -c int ip dump >c:\\ip.txt

so you will see a root directory in the C drive The ip.txt file contains the settings information of your current network card. In order to more clearly see the IP setting information, it is recommended to add 2-3 IPs before executing the above command.

Then edit this file and add the IP you want to add, according to the same rules. Then execute netsh -fc:\\ip.txt

IP, if the IP is a lot, the time will be longer. If there is no error message after the operation is completed, then the addition is successful. Go to the control panel and see if it is there. It is.

Method 2:

Add IP in batches using CMD, eliminating the need for manual input.

For example, if there are multiple IP addresses, such as from =192.168.1.120= to =192.168.1.149=, how to add them to Windows
in batches or automatically?

Open CMD, enter the following code (please replace it first) FOR /L %i IN (163,1,190) DO netsh interface ip add address "Ethernet 2" addr=192.168.1.%i 255.255.255.224

1, (163,1,190) 163 represents the starting IP, 1 represents an increase of 1 each time, and 190 represents the ending IP. 2. Ethernet 2 Please replace it with the server NIC name. 3,192.168.1, please replace it with the C segment of ip. 4,255.255.255.224, please replace it with the corresponding gateway.

Copyright © Windows knowledge All Rights Reserved