My ISP provides me an internet connection with dynamic IP. when i need to change my ip i simply disconnect my dial-up connection using a bat file (rasdial "dial-up connection name" /disconnect) and reconnect with same bat file using command rasdial "dial-up connection name" username password. It mostly works but sometime it is annoying to find afterward while browsing that my IP has not changed. It happens say once in every 10 to 15 attempts. Can there be a bat file which on execution notes current Ip address then disconnects internet then reconnects and then verifies whether Ip address has changed or not and if IP address has not changed it goes back to disconnect and reconnect until IP address changes.
feedback
|
migrated from stackoverflow.com Aug 29 '09 at 14:32
This question came from our site for professional and enthusiast programmers.
|
Something like this should work
| |||
|
feedback
|
|
If you need to do so in a bat, you could use a I am not sure why you would 'need' to change your IP address. I would be interested in understanding the reasons, as they aren't as obvious as you indicate they should be in your comment. | |||
feedback
|
|
Have you contacted your ISP support?
You might need to wait a significant portion of the lease time to renew, although if you get a different address 90+% of the time, maybe not. I've generally been more concerned with preserving the address, so I'm not sure what you should do to avoid that. Nonetheless, these might be informative: | |||
|
feedback
|
|
If you can change your MAC address each time you run the script, you will certainly receive a new IP from DHCP server. Chances of MAC conflicts are pretty low. | |||
|
feedback
|
|
Hmmm. How to Beat Rapidshare Download Limits and Waiting Time? In response to the down vote on this answer... | ||||
|
feedback
|
|
It often happens that if you connect too fast, then you get the same IP address. On my ISP, for example, a delay of at least 15 minutes is required for a new IP, but may take longer. | |||
|
feedback
|
