How to add multiple IPs with a Command line to windows server

FOR /L %I IN (2,1,254) DO netsh interface ip add address "Public" 1.2.3.4-99I 255.255.255.0





FOR /L %I IN (10,1,20) DO netsh interface ip add address "Public" 67.22.135.%I 255.255.254.0

Above is the command with which you can add multiple IPs to the windows servers.

Now how to use it


the values that are in Brackets (10,1,20) , its the IP range that you are looking add for the host ID
So once you execute that command it will add the IPs from 1.2.3.10 to 1.2.3.20. The Value 1 should not
be changed.

Public is the interface where you are looking to add the IPs and the Subnet mask should be there e.g.255.255.254.0
Novaroot Reviewed by Novaroot on . How to add multiple IPs with a Command line to windows server How to add multiple IPs with a Command line to windows server FOR /L %I IN (2,1,254) DO netsh interface ip add address "Public" 1.2.3.4-99I 255.255.255.0 FOR /L %I IN (10,1,20) DO netsh interface ip add address "Public" 67.22.135.%I 255.255.254.0 Rating: 5