Hi guys
I am trying to update my dns address for a specific wan port and would like to know if its possible with wget script. I have a 3 wan ports and would like to update address of wan3. Wan1 is my first route which means every time i run the script wan1 ip gets sent to afrad.org . Any way i can throw a interface=wan3 into the wget script or something which will send wan3 address to afraid?
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
Thanks
efaden
January 21, 2014, 5:56pm
2
happydaddy:
Hi guys
I am trying to update my dns address for a specific wan port and would like to know if its possible with wget script. I have a 3 wan ports and would like to update address of wan3. Wan1 is my first route which means every time i run the script wan1 ip gets sent to afrad.org . Any way i can throw a interface=wan3 into the wget script or something which will send wan3 address to afraid?
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
Thanks
I have looked into this before. As far as I figured out it isn’t possible in a simple fashion. … I came up with a theoretical solution to utilize “modified” URLs and some mangle rules to mark routes…
e.g. /tool fetch url=“http://freedns-ETH1.afraid.org/dynamic/update.php\randomKey ” … or something like that… match on layer-7. I never actually tested the idea though.
Freedns.afraid.org now for me is 178.33.33.231
So you can do this:
/ip route add dst-address=178.33.33.231 gateway=1.1.1.1
Change 1.1.1.1 for your wan3 gateway
Send from my mobile phone using Tapatalk.
c0d3rSh3ll:
Freedns.afraid.org now for me is 178.33.33.231
So you can do this:
/ip route add dst-address=178.33.33.231 gateway=1.1.1.1
Change 1.1.1.1 for your wan3 gateway
Send from my mobile phone using Tapatalk.
I guess this might work if you where only updating 1. In my case I have 3 wan ports I need to update.
efaden
January 22, 2014, 11:40am
5
You “could” script it… so update the route… fetch… update the route… fetch again… update the route… fetch… etc…
That might actually work as long as it is timed correctly…
amee
January 24, 2014, 3:37am
6
May this could answer:
# get freedns.afraid.org
:global a [:resolve freedns.afraid.org]
#update ddns from wan1
/ip ro add dst-address=$a gateway=wan1 comment=ddns
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
#update ddns from wan2
/ip ro add dst-address=$a gateway=wan2 comment=ddns
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
#update ddns from wan3
/ip ro add dst-address=$a gateway=wan3 comment=ddns
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
# remove static gateway
/ip ro rem [find comment=ddns]
efaden
January 24, 2014, 12:37pm
7
Is “fetch” a blocking call?.. e.g. is it guaranteed to finish before continuing the script?
amee
January 25, 2014, 4:32am
8
Yes, it work fine. I have test it, with some corrections:
# get freedns.afraid.org
:global a [:resolve freedns.afraid.org]
#update ddns from wan1
/ip ro add dst-address=$a gateway=wan1 comment=ddns
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
#update ddns from wan2
/ip ro set [find comment=ddns] dst-address=$a gateway=wan2
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
#update ddns from wan3
/ip ro set [find comment=ddns] dst-address=$a gateway=wan3
/tool fetch url="http://freedns.afraid.org/dynamic/update.php\randomKey"
# remove static gateway
/ip ro rem [find comment=ddns]
Tried it but when i run the script no route is added.
efaden
January 25, 2014, 6:16pm
10
Because the last line removes the route…
/ip ro rem [find comment=ddns]
I know that but wile i am running the script should i not see it come and go?
efaden
January 25, 2014, 6:23pm
12
Maybe.. Just depends on the speed
Sent from my SCH-I545 using Tapatalk
Freedns has a hidden feature, you can add &address=x.x.x.x to the update url
4). If you are behind a firewall and Free DNS is not detecting your IP address correctly, you can add &address=127.0.0.2 to the update string, to override Free DNS auto-detection. To see the order and/or HTTP variables checked that Free DNS attempts to detect your IP address, you can click here