Feature Request: /tool fetch Add specific interface

Hello. I have found several similar requests on this forum, although they haven’t been implemented yet. Currently I use mange rules to make fetch resolve web site through specific routing table. It would be great to use it as embedded function. Thank you in advance.

There has been much work on improving fetch on the router, at least what I see in the development side.
If you have a specific idea, provide it where such ideas belong……

src-address=... already exist... just use the right IP address appropriate with the routing tables...

rextended

I use this parameter, although I have noticed that despite the src-address having been indicated, fetch will still establish connection via the default route with the lower distance (I have got 2 default gateways in the main routing table with distances 1 and 2), ONLY WHEN 2 connections are established simultaneously (via script). They work correctly only separately.

As a solution I have decided to use different dst-address:

/ip firewall mangle
add action=mark-connection chain=output comment="Failover test ISP1" connection-state=new dst-address=1.0.0.1 dst-port=443 new-connection-mark=
failover_test_ISP1 protocol=tcp src-address=10.10.10.153
add action=mark-connection chain=output comment="Failover test ISP2" connection-state=new dst-address=104.16.132.229 dst-port=443
new-connection-mark=failover_test_ISP2 protocol=tcp src-address=10.10.20.150
add action=mark-routing chain=output comment="Failover test ISP1" connection-mark=failover_test_ISP1 new-routing-mark=to_ISP1 passthrough=no
add action=mark-routing chain=output comment="Failover test ISP2" connection-mark=failover_test_ISP2 new-routing-mark=to_ISP2 passthrough=no

In this config it works fine.

You are using “/tool fetch” to implement a failover between 2 ISPs? Why?

correct. I have started from ping test, but one of my ISP is weird, and drops randomly ICMP packets, and there is no sense to argue with them, moreover I have found other wrong configs on their side in other aspects.

Therefore, I have come to decision to use fetch. In addition, this is more reliable and relevant, because I run test up to L6 layer (TLS connection) + DNS test, when ping is L3 test. And eventually, the ISP won’t drop 443 dst port connection.

When you want to use https transfers, why not use netwatch?

because I use multiple logic (check pcc rules state, flush conntrack with specific routing mark, telegram alert). Netwatch is perfect for simple routes switching for example.