Due to a higher number of customers on our ISP (public IP’s are not enough, so they had to NAT) I can’t connect to my Mikrotik, unless I disconnect and reconnect couple times to get a public IP again.
Is there a script that determine public IP range, and when it detects a fake range like 172.x.x.x or 10.x.x.x it disconnects and reconnects by itself with at least 10 retries until it get a public IP?
Please excuse my ignorance, but tried to look for such script before posting but with no avail.
If you think the script should run for every minutes there’s no harm in that, whilst it’s enough to detect the IP upon initiating the PPPeo connection for one time.
Fake IP starts by 192.x.x.x - 172.x.x.x - 10.x.x.x I’m sure we can add more to the script if I see more IP range not listed. But plz take into consideration adding the retries to detect the IP while connecting and disconnecting if I always get a fake IP, I need the router stop running the script otherwise I stay without internet if all the Public IP’s are taken..
If you have anything on your mind please share, I might missed something.
What I need is a script to renew the pppoe ip address if it’s fake. Usually, I click “Reconnect” to let the IP get renewed. Sometimes I get lucky I get a public ip instantly, or I need to click couple times because I’d be connected from fake ip range..
The attachment shows you that I’m connected from Public IP. Hopefully, I explained correctly.
But plz take into consideration adding the retries to detect the IP while connecting and disconnecting if I always get a fake IP, I need the router stop running the script otherwise I stay without internet if all the Public IP’s are taken..
1 * Lets say the script detected a fake IP, it should disconnect then reconnect trying to gain a Public IP. (This would be the first attempt)
2 * Lets say now the connection established but still with fake IP, your script will detect the fake IP then disconnects again and reconnect.. This would be the second attempt, and so on…
3* If it succeed to get a public IP, connection should remain established until further reboot or disconnection..
4* After several consecutive failure attempts to detect a Public IP (Your script is programmed to try 10 times) The script should reconnect and stop operating (it doesn’t matter here if it’s public or fake) .. Because if it kept on trying without getting a public IP, I wont be able to connect to the internet due to the loop of connecting and disconnecting.
You can schedule the script to run again after 1 hour to start it detection…
This is the whole issue is when I get a fake IP from my ISP I won’t be able reach the Mikrotik.. Here where your script will do it job to detect the fake ip and try to get a public one instead ; )
Ok… I get it now… I’ll try to write something to cover it… Give me a day to think about the best way… it will likely take me a few days to a week or two to actually get the time to sit down and write it.
Also… how are you triggering the reconnect?.. are you just doing a dhcp-client renew? or what command are you using? I need to know what command to call to retrigger it.
.. – go up to interface
add – Create a new item
comment – Set comment for items
disable – Disable items
edit –
enable – Enable items
export – Print or save an export script that can be used to restore configuration
find – Find items by value
get – Gets value of item’s property
monitor – Monitor interface status
print – Print values of item properties
remove – Remove item
scan –
set – Change item properties
This is closer… I don’t really have much more time to work on this… you should be able to make this work though… I also don’t have a pppoe-server to test with…
I don’t really have a setup to test and debug. If you want to give me access to your box I can try to debug it live. But it’s just going to require some troubleshooting.