Windows 2003服务器使用netsh批量添加IP地址

举例:
1.添加一个IP地址192.168.1.2
netsh interface ip add address “本地连接” 192.168.1.2 255.255.255.0
2.添加一段IP地址192.168.1.10到192.168.1.20
FOR /L %A IN (10,1,20) DO netsh interface ip add address “本地连接” 192.168.1.%A 255.255.255.0
3.添加一个整个24位的网段192.168.1.0/24(192.168.1.1到192.168.1.254)
FOR /L %A IN (1,1,254) DO netsh interface ip add address “本地连接” 192.168.1.%A 255.255.255.0