Script to change IP address??

pixel_ninja

Expert Member
Joined
May 21, 2010
Messages
1,215
Reaction score
4
Location
Aokautere
Hi guys,

I'm looking for someone who can point me in the right direction, with regards to resetting your IP via a script of some sort (as opposed to manually turning off your router for 10 seconds)

I tried rebooting the router but that doesnt change the IP. I have a vanilla mega105 router, does anyone know if this can be achieved?

WooT
 
ipconfig /release
ipconfig /renew

should do the trick. Now you just need to put it in a script :D

:edit: it will only work if u use your pc to do the dialing and not the router
 
The easiest option will be to access the router via a telnet connection & reset it that way. The details will depend on the router & sometimes you first need to enabled telnet access. Alternatively you could use a PPPoE windows connection & redial that.

Not sure how one would script that. It might be possible via a batch file...but you'd need to issue multiple telnet commands & I'm not sure whether a batch file can do that. You also need to add delays as the telnet response is not instant & if you give the commands to fast it doesn't work. I suspect that you'll need a proper programming language or some really hardcore scripting linux style.

http://mybroadband.co.za/vb/showthread.php/52541-Static-Routing-and-prepaid-Web-Africa

ipconfig /release
ipconfig /renew

should do the trick. Now you just need to put it in a script :D
No. It will only reset the IP on the local network, the internet facing addr will remain as the router is most likely using NAT.
 
If you leave the router off for 5min, you usually get a new ip from telkom.
 
Shot for the fast reply Jouda,

:edit: it will only work if u use your pc to do the dialing and not the router
ie: bridged mode?

so i can just make a batch file with those two lines in it?


EDIT: Whoops, so I guess that wont solve my issue then...

would the router not have an option to "stay off" for the ten seconds? or a force ip renew?
 
Last edited:
Simply resetting the router will not guarantee a new IP address, like Qwikslver said.
I would guess that the router supports remote terminal sessions, and then you might be able to just disable the PPPoE connection using 'ifconfig ppp0 down' and enable it again with 'ifconfig ppp0 up'.
You could then use something like we're doing here to split traffic on generic routers.

Why do you even want a new public IP address?
 
Hi guys,

I'm looking for someone who can point me in the right direction, with regards to resetting your IP via a script of some sort (as opposed to manually turning off your router for 10 seconds)

I tried rebooting the router but that doesnt change the IP. I have a vanilla mega105 router, does anyone know if this can be achieved?

WooT

Only if the IP is assigned to somebody else will you be getting a new one realistically....so requesting a programmatic way to get somebody else to get your IP is a bit unrealistic. Having the router restart is your own manual stab in the dark and tends to work if there are alot of users connecting and disconnecting
 
a programmatic way to get somebody else to get your IP is a bit unrealistic.
Worse case scenario is you have to check the new IP & just repeat until its a new one.

In which case it won't help as RS will be picking up the IP of the transparent proxy?
If that were the case then pretty much nobody in SA could download from RS. RS only allocates like a few 100 meg per IP, so it would be constantly blocked which it isn't. No idea how but I can only conclude that somehow they worked around that issue...maybe its whitelisted.
 
Why do you even want a new public IP address?

Basically I want to vote in a poll numerous times and I think that they have a database which logs your IP, then you cant vote for 24 hours or w/e.

:D not raping the ISP's so you can put your daggers away :P
 
Basically I want to vote in a poll numerous times and I think that they have a database which logs your IP, then you cant vote for 24 hours or w/e.

:D not raping the ISP's so you can put your daggers away :P
Not sure manipulating votes is any better.
 
a poll worth swaying would require one to register and login to vote. i can imagine its not impossible to create clones, but you're still stuck with the slep of doing it manually
 
Top
Sign up to the MyBroadband newsletter
X