NETSH : Set default ip address for an interface with multiple Ips

Posted by elarichi.y on Server Fault See other posts from Server Fault or by elarichi.y
Published on 2014-06-06T11:11:14Z Indexed on 2014/06/06 15:29 UTC
Read the original article Hit count: 209

Filed under:
|

To test a load balancer I need to switch my ip address several time a day, and keep other ips routing trough other Wans. I run these commands in a batch script:

netsh interface ip set address "Connexion au réseau local" static %ipd% 255.255.255.0 192.168.1.1 1
netsh in ip add address "Connexion au réseau local" %ips1% 255.255.255.0
netsh in ip add address "Connexion au réseau local" %ips2% 255.255.255.0

ipd: is the default ip I want to set (all traffic should go trough it).

ips1 and ips2 : are the secondary ips I want to keep

but what ever I do all traffic goes trough one IP !! (first one in the range)

Please help me with this issue.

© Server Fault or respective owner

Related posts about netsh

Related posts about multi-wan