Fetch tool over VPN

Hello,

I have a question and i could not find the answer in the forum or wiki.
I want to use the tool fetch to get a file from our server to my mikrotik, but the file on the server is only reachable through VPN.
The device has a vpn-ipsec tunnel to connect to the server, client data goes through that tunnel, no problem.
But if i try to fetch anything on the mikrotik device, it uses plain internet, not the vpn tunnel.
So it ends up in a “forbidden” status.
Is there something i can do to force the device to use the vpn tunnel to fetch that file?
I can not give in a src-addres in fetch like i do in ping commands, and the only other thing i can think of is trying to change default routes.
Any ideas?

Thanks in advance!

Specify the VPN address like this:

tool fetch address=(VPN Facing Address)

Well the thing is that i need to connect to a certain url after the VPN, so you mean doing it like this?

/tool fetch address= “VPN addres” mode=http url=“http://x.x.x.x/index.php” dst-path=myfile.rsc
The x.x.x.x part is a private range only reachable after the vpn.

I’ve tried this but it doesn’t work right away.

is anybody resolved this ?

How to forward the “toll fetch” into a ipsec or a vpn tunnel?

Faced the same issue, fetch is not routing through VPN, using address argument with VPN facing IP doesn’t help too. Any workaround?

If it is a plain IPsec VPN, try adding an individual route for the destination with pref-src set to a local IP address matched by policy. The gateway may be the same like for the default route, it is not important, the packet just must be routed “somewhere” so that the IPsec policy could match it.

Maybe a static route into vpn interface?

With plain IPsec in tunnel mode, there is no VPN interface, which causes a lot of confusion until you get used to the whole concept.