Hello,
I am very new to using Mikrotik. I use a CHR in my homelab.
I have two ISPs, from each of them I get a dynamic IPv4 address.
I want to route some of the connections via ISP2 based on the destination port. As I understood, I have to use Mangle Rules to accomplish that. I did set that up according to the mikrotik wiki.
To test the configuration, I created a new mangle rule, which matches ICMP traffic to 1.1.1.1 - just to see, if this would send my packets via ISP2, but this seems not to work.
Also i don’t quite understand, what I have to do, with the 2 new routing tables. Currently all my routes are in “main”. I tried adding new routes in the 2 other tables, but I can’t statically enter the dst. ip address since my ISP provides me with a dynamic IPv4.
Also I am unsure, when to use passthrough on the mangle rules and when not.
mangle:
[admin@MikroTik] /ip/firewall/mangle> print
Flags: X - disabled, I - invalid; D - dynamic
0 chain=prerouting action=mark-connection new-connection-mark=ISP1_Conn passthrough=yes connection-mark=no-mark in-interface=WAN-DREI log=no log-prefix=""
1 chain=prerouting action=mark-connection new-connection-mark=ISP2_Conn passthrough=yes connection-mark=no-mark in-interface=WAN-INNONET log=no log-prefix=""
2 chain=prerouting action=mark-connection new-connection-mark=ISP1_Conn passthrough=yes psd=21,3s,3,1 dst-address-type=!local connection-mark=no-mark in-interface=bridge1 limit=1,5:packet dst-limit=1,5,dst-address/1m40s
time=0s-1d,sun,mon,tue,wed,thu,fri,sat per-connection-classifier=both-addresses:2/0 log=no log-prefix=""
3 chain=prerouting action=mark-connection new-connection-mark=ISP2_Conn passthrough=yes psd=21,3s,3,1 dst-address-type=!local connection-mark=no-mark in-interface=bridge1 limit=1,5:packet dst-limit=1,5,dst-address/1m40s
time=0s-1d,sun,mon,tue,wed,thu,fri,sat per-connection-classifier=both-addresses:2/1 log=no log-prefix=""
4 chain=prerouting action=mark-routing new-routing-mark=to_ISP1 passthrough=yes connection-mark=ISP1_Conn in-interface=bridge1 log=no log-prefix=""
5 chain=prerouting action=mark-routing new-routing-mark=to_ISP2 passthrough=yes connection-mark=ISP2_Conn in-interface=bridge1 log=no log-prefix=""
6 chain=output action=mark-routing new-routing-mark=to_ISP1 passthrough=yes connection-mark=ISP1_Conn log=no log-prefix=""
7 chain=output action=mark-routing new-routing-mark=to_ISP2 passthrough=yes connection-mark=ISP2_Conn log=no log-prefix=""
8 chain=prerouting action=mark-connection new-connection-mark=ISP2_Conn passthrough=yes protocol=icmp dst-address=1.1.1.1 in-interface=bridge1 log=no log-prefix=""
/ip/route:
[admin@MikroTik] /ip/route> print
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, d - DHCP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
DST-ADDRESS GATEWAY DISTANCE
DAd 0.0.0.0/0 178.xxx.xxx.xxx 1
DAc 149.xxx.xxx.xxx/23 WAN-INNONET 0
DAc 172.27.63.0/24 VLAN-IOT 0
DAc 178.xxx.xxx.xxx/27 WAN-DREI 0
DAc 192.168.1.0/24 bridge1 0