[Ask] How to route different file type with multiple gateway

Dear all,
(the newbie want to ask something, sorry for posting in wrong sub topic)

I had problem with routing and packet marking, when my client downloading / uploading file type like (exe,jpeg,bmp) i want that’s file route to my gateway B, and other packet like browsing route to gateway A.

here is my script, ( something wrong with my script???): only for exefile i attached here

/ ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local 
add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=wlan2
add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=wlan1

/ip fire mangle
(exe file)
add chain=prerouting src-address-list=exefile in-interface=Local action=mark-connection new-connection-mark=exefile passthrough=yes 
add chain=prerouting src-address-list=exefile in-interface=Local action=mark-routing new-routing-mark=exefile passthrough=no
add chain=prerouting in-interface=Local content=application/octet-stream action=mark-connection new-connection-mark=exefile passthrough=yes
add chain=prerouting in-interface=Local action=add-src-to-address-list address-list=exefile address-list-timeout=1d connection-mark=exefile passthrough=yes 
add chain=prerouting in-interface=Local connection-mark=exefile action=mark-routing new-routing-mark=exefile passthrough=no

/ip firewall nat
add chain=srcnat connection-mark=exefile action=src-nat to-addresses=10.111.0.2 to-ports=0-65535 

/ ip route
(for routing exe)
add dst-address=0.0.0.0/0 gateway=10.111.0.1 scope=255 target-scope=10 routing-mark=exefile

(for routing other packet)
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10

Thanks for your help all

If you want to catch .exe files you should use application/x-msdos-program

But I believe that it is not possible to correctly redirect exe or other files.

add chain=prerouting in-interface=Local content=application/octet-stream action=mark-connection new-connection-mark=exefile passthrough=yes
Rule above marks already established connection, but through /ip firewall NAT goes only new connections. It means that it probably won’t work

excuse me…

why we cannot redirect exe file / other type to different gateway?? i just re-work the code in wiki (transparant traffic shaper with odd/even connection with multiple gateway)

need explanation, please…

Thank you.

Hi Closed_1

If a file download is started, the connection state is already active. This means the file is already downloaded from your DEFAULT gateway, and if you now change the gateway, the download will more than likely fail, even when using a download manager, as everytime the download is restarted, the gateway changes.

I also attempted something similar. My plan was to only allow WEB content to be routed via our high quality but very expensive bandwidth, and route all downloads via a different route.

I surely wish it was possible.

I hope I’m making sense. G