Aleksandar's computer workshop
Let's see what Aleksandar was fixing today.
My findings, tips & tricks related to computers, internet, programming and other stuff I was working with.

How to add bunch of IP addresses to Windows network connection from command line

February 29, 2008 21:18 by Aleksandar
To add a bunch of IP addresses in Windows XP/Server 2003 to a network connection without having to type each one individually create a batch file like the below:

netsh in ip add address "Local Area Connection" 10.0.0.2 255.0.0.0
netsh in ip add address "Local Area Connection" 10.0.0.3 255.0.0.0
netsh in ip add address "Local Area Connection" 10.0.0.4 255.0.0.0
netsh in ip add address "Local Area Connection" 10.0.0.5 255.0.0.0
netsh in ip add address "Local Area Connection" 10.0.0.6 255.0.0.0
[...]
netsh in ip add address "Local Area Connection" 10.0.0.224 255.0.0.0

or just do a command like


for /L %a in (2,1,224) do netsh in ip add address "Local Area Connection" 10.0.0.%a 255.0.0.0

Both methods will add IP's in range from 10.0.0.2 up to 10.0.0.224 to the network device named "Local Area Connection"

Tags:
Categories: Networking | Windows
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed