What's new

Script to avoid getting any used IP address again

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

mensa

Occasional Visitor
Hello,

I created a Script on my Tomato Router to get an (by me in the past unused) IP address, which is started by need by myself and does the following:

- Determine the current WAN IP
- Protocol the current WAN IP in wan_ip_history.txt
- Get a new WAN IP (service wan restart)
- Check if the new WAN IP already is showing up in wan_ip_history.txt
+ If already showing up in protocol: Do "service wan restart" max. 10 times again, protocol and warn if no unused IP has been gotten
+ If not showing up in protocl: Protocol the new IP in wan_ip_history.txt and exit the script

That is working very fine and my ISP does have enough IPs that I can have thousand differents per month without many tries.

But the problem is, that my Internet Service Provider is giving me a new IP at least every 24 hours and there also can be power breakdwons in my house (the router will reboot and get a new IP). So what is the correct way to protocol my used IPs in the WAN UP Scripts? Or do I have to put the script in an other "Admin - Script"? Is there maybe any command which I can use in the WAN Up Script to get a new IP which does NOT create a new instance of the WAN Up Script? Otherwise it will end in a loop, if I say "service wan restart" in the WAN Up Script, cause it is calling itself endless again.

I tried to put my WanIPRenewScript in the WAN-UP Section, but then the router gets in a loop and reconnects the whole time, even if it got an unused IP address. Can you please help me to get that working for provider reconnects and power losses also?
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top