Hello people!!!
In a RB11000AHx4 (RouterOS and Firmware v6.47.1) with 2 WAN interfaces, I did some marks trying to accomplish the following:
- Which is incomming from WAN1, goes out through WAN1, the same for WAN2
- Some random local IPs goes out through WAN1, and other through WAN2
- There are few public dst-addresses which should use an specific WAN
For test purpouse I added in the 6th position a rule to use WAN1 for connections from 192.168.1.54
In “IP → Firewall → Connections”, I filter src-address=192.168.1.54 and everything is with ISP2_conn connection mark
I have tried removing the “Passthrough” option to the 6th rule with the same result, so I think it is something before this rule
I have tried selecting only new packets in the 4th and 5th rules with the same result
Here is the code:
/ip firewall mangle
add action=accept chain=prerouting dst-address=181.30.25.184/29 src-address=192.168.1.0/24
add action=accept chain=prerouting dst-address=186.23.255.112/29 src-address=192.168.1.0/24
add action=accept chain=prerouting dst-address=172.16.0.0/23 comment="No Mark dst VPN"
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether1 new-connection-mark=ISP1_con passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether2 new-connection-mark=ISP2_con passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address=!192.168.1.0/24 new-connection-mark=ISP1_con passthrough=yes src-address=192.168.1.54
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address=!192.168.1.0/24 new-connection-mark=ISP1_con passthrough=yes src-address=192.168.1.4
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-list=ISP1publics new-connection-mark=ISP1_con passthrough=yes src-address=192.168.1.0/24
add action=mark-connection chain=prerouting connection-mark=no-mark dst-address-list=ISP2publics new-connection-mark=ISP2_con passthrough=yes src-address=192.168.1.0/24
add action=mark-connection chain=prerouting dst-address=!192.168.1.0/24 new-connection-mark=ISP1_con packet-mark=no-mark passthrough=yes per-connection-classifier=src-address:2/0 src-address=192.168.1.0/24
add action=mark-connection chain=prerouting dst-address=!192.168.1.0/24 new-connection-mark=ISP2_con packet-mark=no-mark passthrough=yes per-connection-classifier=src-address:2/1 src-address=192.168.1.0/24
add action=mark-routing chain=output connection-mark=ISP1_con dst-address=!192.168.1.0/24 new-routing-mark=to_ISP1 passthrough=no
add action=mark-routing chain=output connection-mark=ISP2_con dst-address=!192.168.1.0/24 new-routing-mark=to_ISP2 passthrough=no
add action=mark-routing chain=prerouting connection-mark=ISP1_con dst-address=!192.168.1.0/24 new-routing-mark=to_ISP1 passthrough=no src-address=192.168.1.0/24
add action=mark-routing chain=prerouting connection-mark=ISP2_con dst-address=!192.168.1.0/24 new-routing-mark=to_ISP2 passthrough=no src-address=192.168.1.0/24
I just removed all spanish comments and changed ISPs names with ISP1 and ISP2
When I do a ping to a public IP from 192.168.1.54 I see that the 6th rule increment the packet counter in 1
I cant see my mistake
Any idea?
Thanks in advance.
Regards,
Damián