Thanks Sob,
I am having difficulty with the mangle and marking packets. I appreciate that I need to set up multi-WAN. For this test I am using “only” 4 IPs. I thought this would be a good guide, https://www.youtube.com/watch?v=67Dna_ffCvc, it certainly made sense as I watched it. The slides are available here: https://mum.mikrotik.com/presentations/US12/tomas.pdf
On slide 23 of that he says:
Required steps:
- Create routing tables
- Setup address-lists
- Setup mangle
- Configure Traffic Monitor
I figured since I am not load balancing, I just want to rout traffic back out the interface it came in on and as such the first three parts are all I need. Maybe that is wrong as I seem to be missing something.
My routing tables:
@MikroTik] /ip route> print detail
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
0 A S dst-address=0.0.0.0/0 gateway=WAN1 gateway-status=WAN1 reachable distance=1 scope=30 target-scope=10 routing-mark=WAN1_Route
1 A S dst-address=0.0.0.0/0 gateway=WAN2 gateway-status=WAN2 reachable distance=1 scope=30 target-scope=10 routing-mark=WAN2_Route
2 A S dst-address=0.0.0.0/0 gateway=WAN3 gateway-status=WAN3 reachable distance=1 scope=30 target-scope=10 routing-mark=WAN3_Route
3 A S dst-address=0.0.0.0/0 gateway=WAN4 gateway-status=WAN4 reachable distance=1 scope=30 target-scope=10 routing-mark=WAN4_Route
4 ADS dst-address=0.0.0.0/0 gateway=154.5.66.1 gateway-status=154.5.66.1 reachable via WAN1 distance=1 scope=30 target-scope=10 vrf-interface=WAN1
5 ADC dst-address=154.5.66.0/24 pref-src=154.5.66.67 gateway=WAN1 gateway-status=WAN1 reachable distance=0 scope=10
6 ADC dst-address=154.5.66.0/32 pref-src=154.5.66.86 gateway=WAN2,WAN3,WAN4 gateway-status=WAN2 reachable,WAN3 reachable,WAN4 reachable distance=0 scope=10
7 ADC dst-address=192.168.88.0/24 pref-src=192.168.88.1 gateway=LAN bridge gateway-status=LAN bridge reachable distance=0 scope=10
I renamed the interfaces:
@MikroTik] /interface> print
Flags: D - dynamic, X - disabled, R - running, S - slave
# NAME TYPE ACTUAL-MTU L2MTU MAX-L2MTU MAC-ADDRESS
0 R WAN1 ether 1500 1598 8156 74:4D:28:2F:4D:A3
1 R WAN2 ether 1500 1598 8156 74:4D:28:2F:4D:A4
2 R WAN3 ether 1500 1598 8156 74:4D:28:2F:4D:A5
3 R WAN4 ether 1500 1598 8156 74:4D:28:2F:4D:A6
4 ether5 ether 1500 1598 8156 74:4D:28:2F:4D:B1
5 RS ether6 ether 1500 1598 8156 74:4D:28:2F:4D:B3
6 S ether7 ether 1500 1598 8156 74:4D:28:2F:4D:B4
7 S ether8 ether 1500 1598 8156 74:4D:28:2F:4D:B5
8 S ether9 ether 1500 1598 8156 74:4D:28:2F:4D:B6
9 S ether10 ether 1500 1598 8156 74:4D:28:2F:4D:B7
10 S sfp1 ether 1500 1600 8158 74:4D:28:2F:4D:B2
11 R ;;; defconf
LAN bridge bridge 1500 1598 74:4D:28:2F:4D:AE
and attempted to mark incoming packets with the interface name:
@MikroTik] /ip firewall mangle> print
Flags: X - disabled, I - invalid, D - dynamic
0 D ;;; special dummy rule to show fasttrack counters
chain=prerouting action=passthrough
1 D ;;; special dummy rule to show fasttrack counters
chain=forward action=passthrough
2 D ;;; special dummy rule to show fasttrack counters
chain=postrouting action=passthrough
3 chain=prerouting action=accept src-address-list=Connected dst-address-list=Connected
4 chain=input action=mark-connection new-connection-mark=WAN1-->ROS connection-mark=no-mark in-interface=WAN1
5 chain=input action=mark-connection new-connection-mark=WAN2-->ROS connection-mark=no-mark in-interface=WAN2
6 chain=input action=mark-connection new-connection-mark=WAN3-->ROS connection-mark=no-mark in-interface=WAN3
7 chain=input action=mark-connection new-connection-mark=WAN4-->ROS connection-mark=no-mark in-interface=WAN4
8 chain=output action=mark-routing new-routing-mark=WAN1_Route connection-mark=WAN1-->ROS
9 chain=output action=mark-routing new-routing-mark=WAN2_Route connection-mark=WAN2-->ROS
10 chain=output action=mark-routing new-routing-mark=WAN3_Route connection-mark=WAN3-->ROS
11 chain=output action=mark-routing new-routing-mark=WAN4_Route connection-mark=WAN4-->ROS
I then try to port forward http,https, and ssh :
@MikroTik] /ip firewall nat> print
Flags: X - disabled, I - invalid, D - dynamic
0 ;;; defconf: masquerade
chain=srcnat action=masquerade out-interface-list=*2000010 ipsec-policy=out,none
1 chain=srcnat action=masquerade out-interface=WAN1 log=yes log-prefix="WAN1_masquerade"
2 chain=srcnat action=masquerade out-interface=WAN2 log=yes log-prefix="WAN2_masquerade"
3 chain=srcnat action=masquerade out-interface=WAN3 log=yes log-prefix="WAN3_masquerade"
4 chain=srcnat action=masquerade out-interface=WAN4 log=yes log-prefix="WAN4_masquerade"
5 ;;; test1_ http
chain=dstnat action=dst-nat to-addresses=192.168.88.10 to-ports=80 protocol=tcp dst-address=154.5.66.67 dst-port=80 log=yes log-prefix="test1_http"
6 ;;; test1_https
chain=dstnat action=dst-nat to-addresses=192.168.88.10 to-ports=443 protocol=tcp dst-address=154.5.66.67 dst-port=443 log=yes log-prefix="test1_https"
7 ;;; test1_ssh
chain=dstnat action=dst-nat to-addresses=192.168.88.10 to-ports=22 protocol=tcp dst-address=154.5.66.67 dst-port=22 log=yes log-prefix="test1_ssh"
8 ;;; TEST2_HTTPS
chain=dstnat action=dst-nat to-addresses=192.168.88.20 to-ports=443 protocol=tcp dst-address=154.5.66.86 dst-port=443 log=yes log-prefix="TEST2_HTTPS"
9 ;;; TEST2_HTTP
chain=dstnat action=dst-nat to-addresses=192.168.88.20 to-ports=80 protocol=tcp dst-address=154.5.66.86 dst-port=80 log=yes log-prefix="TEST2_HTTP"
10 ;;; TEST2_SSH
chain=dstnat action=dst-nat to-addresses=192.168.88.20 to-ports=22 protocol=tcp dst-address=154.5.66.86 dst-port=22 log=yes log-prefix="TEST2_SSH"
11 ;;; test3_https
chain=dstnat action=dst-nat to-addresses=192.168.88.30 to-ports=443 protocol=tcp dst-address=154.5.66.91 dst-port=443 log=yes log-prefix="test3_https"
12 ;;; test3_http
chain=dstnat action=dst-nat to-addresses=192.168.88.30 to-ports=80 protocol=tcp dst-address=154.5.66.91 dst-port=80 log=yes log-prefix="test3_http"
13 ;;; test3_ssh
chain=dstnat action=dst-nat to-addresses=192.168.88.30 to-ports=22 protocol=tcp dst-address=154.5.66.91 dst-port=22 log=yes log-prefix="test3_ssh"
14 ;;; TEST4_HTTPS
chain=dstnat action=dst-nat to-addresses=192.168.88.40 to-ports=443 protocol=tcp dst-address=154.5.66.92 dst-port=443 log=yes log-prefix="TEST4_HTTPS"
15 ;;; TEST4_HTTP
chain=dstnat action=dst-nat to-addresses=192.168.88.40 to-ports=80 protocol=tcp dst-address=154.5.66.92 dst-port=80 log=yes log-prefix="TEST4_HTTP"
16 ;;; TEST4_SSH
chain=dstnat action=dst-nat to-addresses=192.168.88.40 to-ports=22 protocol=tcp dst-address=154.5.66.92 dst-port=22 log=yes log-prefix="TEST4_SSH"
I am seeing a lot of “out: unknown” in the logs:
4:11:46 firewall,info test3_http dstnat: in:WAN3 out:(unknown 0), src-mac 84:26:2b:60:8f:17, proto TCP (SYN), 64.251.74.210:50987->154.5.66.91:80, len 52
14:11:46 firewall,info test1_ssh dstnat: in:WAN1 out:(unknown 0), src-mac 84:26:2b:60:8f:17, proto TCP (SYN), 222.186.15.91:42956->154.5.66.67:22, len 60
14:11:46 firewall,info TEST4_HTTP dstnat: in:LAN bridge out:(unknown 0), src-mac 00:15:17:4a:88:1e, proto TCP (SYN), 192.168.88.44:59354->154.5.66.92:80, len 60
14:11:46 firewall,info test3_http dstnat: in:WAN3 out:(unknown 0), src-mac 84:26:2b:60:8f:17, proto TCP (SYN), 64.251.74.210:50988->154.5.66.91:80, len 52
14:11:47 firewall,info TEST4_HTTP dstnat: in:LAN bridge out:(unknown 0), src-mac 00:15:17:4a:88:1e, proto TCP (SYN), 192.168.88.44:59356->154.5.66.92:80, len 60
14:11:48 firewall,info TEST2_HTTP dstnat: in:WAN2 out:(unknown 0), src-mac 84:26:2b:60:8f:17, proto TCP (SYN), 64.251.74.210:50989->154.5.66.86:80, len 52
14:11:49 firewall,info TEST2_HTTP dstnat: in:WAN2 out:(unknown 0), src-mac 84:26:2b:60:8f:17, proto TCP (SYN), 64.251.74.210:50990->154.5.66.86:80, len 52
14:11:52 firewall,info test1_https dstnat: in:WAN1 out:(unknown 0), src-mac 84:26:2b:60:8f:17, proto TCP (SYN), 64.251.74.210:50991->154.5.66.67:443, len 52
I feel like I am close, but missing something very important.
Can anyone help me to get this working?