Community discussions

MikroTik App
 
zainarbani
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 54
Joined: Thu Jul 22, 2021 9:42 am
Location: Pati, Indonesia

Feature request: Fetch through specific interface/WAN/gateway

Tue Nov 09, 2021 9:42 am

Basically equivalent for curl --interface
Please add this feature on RouterOS

it does the trick tho, but prebuilt Fetch options should be better
   # resolve IP address
   :foreach o in={"some.url1.com"; "some.url2.com"} do={
    /ip firewall address-list add list=myurl address=$o timeout=15s
    :delay 3;
    # get resolved (dynamic) IP from url above
    :foreach p in=[/ip firewall address-list find comment=$o dynamic=yes] do={
     :local addr [/ip firewall address-list get $p address];
     # add routes to specific interface/gateway
     /ip route add gateway=$gw dst-address=$addr comment=to-isp2
    }
   }
   .....
   # clear custom routes after fetch done
   /ip route remove [find where comment=to-isp2]

Who is online

Users browsing this forum: Bing [Bot], djferdinad, Google [Bot], holvoetn, kobuki, llamajaja and 56 guests