I’ve installed RB5009 and terminated my 3 WAN connections in it. I am using 1 ethernet port for my LAN-Users and another for my servers’ LAN. When I create a NAT rule to forward a port to specific IP from my server LAN, sometimes a rule works on WAN1, sometimes on WAN2 or sometimes on WAN3.
Here is my router configuration. Real IP addresses of my WAN are replaced with 123.123.123.202 for WAN1, 181.191.111.43 for WAN2 and 123.123.200.250 for WAN3.
My WAN1 and WAN3 routes are configured as bridge whereas WAN2 router is configured as router mode,
2024-10-30 16:50:34 by RouterOS 7.16.1
software id = ICP1-4SCV
model = RB5009UG+S+
serial number =
/interface ethernet
set [ find default-name=ether1 ] comment=LAN name=ether1-HO_LAN
set [ find default-name=ether2 ] comment=Servers-LAN name=ether2-Servers
set [ find default-name=ether5 ] comment=Wateen name=ether5-WAN_1
set [ find default-name=ether6 ] comment=PTCL name=ether6-WAN_2
set [ find default-name=ether7 ] comment=VPN_Link name=ether7-WAN_3
set [ find default-name=ether8 ] comment=“Link to AMG” name=ether8-VPN_AMG
/interface list
add comment=“WAN Interfaces” name=WAN
/interface list member
add interface=ether5-WAN_1 list=WAN
add interface=ether6-WAN_2 list=WAN
add interface=ether7-WAN_3 list=WAN
/ip dhcp-server
add interface=ether5-WAN_1 lease-time=1d name=ISP-1
add interface=ether6-WAN_2 lease-time=1d name=ISP-2
add interface=ether1-HO_LAN lease-time=1d10m name=HO-LAN
add interface=ether2-Servers lease-time=1d name=Servers
add interface=ether8-VPN_AMG lease-time=1d name=AMG
/ip pool
add name=VPN_Pool ranges=10.10.10.51-10.10.10.150
/ppp profile
add local-address=10.10.10.1 name=OpenVPN remote-address=VPN_Pool
/routing table
add fib name=To_WAN1
add fib name=To_WAN2
add fib name=To_WAN3
/interface ovpn-server server
set auth=sha1 certificate=Server cipher=aes256-cbc default-profile=OpenVPN
enabled=yes require-client-certificate=yes
/ip address
add address=123.123.123.202/30 comment=Wateen interface=ether5-WAN_1 network=
123.123.123.200
add address=192.168.200.10/24 comment=PTCL interface=ether6-WAN_2 network=
192.168.200.0
add address=192.168.6.1/24 comment=HO_LAN interface=ether1-HO_LAN network=
192.168.6.0
add address=192.168.15.1/24 comment=AMG-Network interface=ether8-VPN_AMG
network=192.168.15.0
add address=192.0.0.99/24 comment=Servers interface=ether2-Servers network=
192.0.0.0
add address=10.10.1.1/24 comment=WireGuard interface=wireguard1 network=
10.10.1.0
add address=123.123.200.250/30 comment=VPN interface=ether7-WAN_3 network=
125.125.200.248
/ip dns
set allow-remote-requests=yes servers=192.0.0.9,192.0.0.10
/ip firewall filter
add action=add-src-to-address-list address-list=Torrent_Conn
address-list-timeout=2m chain=forward layer7-protocol=BitTorrent
src-address-list=!allow-bit
add action=add-src-to-address-list address-list=Streaming_Conn
address-list-timeout=2m chain=forward layer7-protocol=streaming
src-address-list=!allow-bit
add action=accept chain=output comment=“For Netwatch” dst-address=
123.123.200.249 out-interface=ether5-WAN_1 protocol=icmp
add action=drop chain=output dst-address=123.123.200.249 out-interface=
ether6-WAN_2 protocol=icmp
add action=drop chain=output dst-address=123.123.200.249 out-interface=
ether7-WAN_3 protocol=icmp
add action=accept chain=output dst-address=181.191.111.43 out-interface=
ether6-WAN_2 protocol=icmp
add action=drop chain=output dst-address=181.191.111.43 out-interface=
ether5-WAN_1 protocol=icmp
add action=drop chain=output dst-address=181.191.111.43 out-interface=
ether7-WAN_3 protocol=icmp
add action=accept chain=output dst-address=123.123.123.201 out-interface=
ether7-WAN_3 protocol=icmp
add action=drop chain=output dst-address=123.123.123.201 out-interface=
ether6-WAN_2 protocol=icmp
add action=drop chain=output dst-address=123.123.123.201 out-interface=
ether5-WAN_1 protocol=icmp
/ip firewall mangle
add action=accept chain=prerouting dst-address=192.0.0.0/24
add action=accept chain=prerouting dst-address=192.168.10.0/24
add action=accept chain=prerouting dst-address=192.168.15.0/24
add action=mark-connection chain=input comment=“Input Rules for WAN Links”
in-interface=ether5-WAN_1 new-connection-mark=WAN1_Conn passthrough=yes
add action=mark-connection chain=input in-interface=ether6-WAN_2
new-connection-mark=WAN2_Conn passthrough=yes
add action=mark-connection chain=input in-interface=ether7-WAN_3
new-connection-mark=WAN3_Conn passthrough=yes
add action=mark-connection chain=prerouting comment=“Mark Connection Rules”
connection-mark=no-mark connection-state=new in-interface=ether5-WAN_1
new-connection-mark=WAN1_Conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark
connection-state=new in-interface=ether6-WAN_2 new-connection-mark=
WAN2_Conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark
connection-state=new disabled=yes in-interface=ether7-WAN_3
new-connection-mark=WAN3_Conn passthrough=yes
add action=mark-connection chain=prerouting comment=“PCC Rules”
connection-mark=no-mark connection-state=new dst-address-type=!local
in-interface=ether1-HO_LAN new-connection-mark=WAN1_Conn passthrough=yes
per-connection-classifier=src-address-and-port:2/0
add action=mark-connection chain=prerouting connection-mark=no-mark
connection-state=new dst-address-type=!local in-interface=ether1-HO_LAN
new-connection-mark=WAN2_Conn passthrough=yes per-connection-classifier=
src-address-and-port:2/1
add action=mark-connection chain=prerouting connection-mark=no-mark
connection-state=new disabled=yes dst-address-type=!local in-interface=
ether1-HO_LAN new-connection-mark=WAN3_Conn passthrough=yes
per-connection-classifier=src-address-and-port:3/2
add action=mark-routing chain=output comment=“Output Rules for WAN Links”
connection-mark=WAN1_Conn new-routing-mark=To_WAN1 passthrough=no
add action=mark-routing chain=output connection-mark=WAN2_Conn
new-routing-mark=To_WAN2 passthrough=no
add action=mark-routing chain=output connection-mark=WAN3_Conn
new-routing-mark=To_WAN3 passthrough=no
add action=mark-routing chain=prerouting comment=“Mark Routes Rules”
connection-mark=WAN1_Conn in-interface=ether1-HO_LAN new-routing-mark=
To_WAN1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN2_Conn
in-interface=ether1-HO_LAN new-routing-mark=To_WAN2 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=WAN3_Conn disabled=
yes in-interface=ether1-HO_LAN new-routing-mark=To_WAN3 passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat comment=“Masquerading for WAN_Connections”
out-interface-list=WAN
add action=dst-nat chain=dstnat comment=“PlayStore IIS” dst-port=80
in-interface=ether5-WAN_1 log=yes log-prefix=192.0.0.3 protocol=tcp
to-addresses=192.0.0.3 to-ports=80
add action=dst-nat chain=dstnat comment=“WebServer (SSL)” dst-port=443
in-interface=ether5-WAN_1 protocol=tcp to-addresses=192.0.0.8 to-ports=
443
add action=dst-nat chain=dstnat comment=“VPN Proxmox” dst-port=1193
in-interface=ether6-WAN_2 log=yes protocol=tcp to-addresses=192.0.0.11
to-ports=1194
add action=dst-nat chain=dstnat comment=WebServer connection-mark=“”
dst-port=80 in-interface=ether7-WAN_3 protocol=tcp to-addresses=
192.0.0.17 to-ports=80
add action=dst-nat chain=dstnat comment=“WebServer (SSL)” dst-port=443
in-interface=ether7-WAN_3 protocol=tcp to-addresses=192.0.0.17 to-ports=
443
add action=dst-nat chain=dstnat comment=PRAL_FTP dst-port=3221 in-interface=
ether5-WAN_1 protocol=tcp to-addresses=192.0.0.17 to-ports=21
add action=dst-nat chain=dstnat comment=DashBoard dst-port=9898 in-interface=
ether5-WAN_1 protocol=tcp to-addresses=192.0.0.22 to-ports=80
add action=dst-nat chain=dstnat comment=WMS_Backup dst-port=421 in-interface=
ether5-WAN_1 protocol=tcp to-addresses=192.0.0.22 to-ports=21
add action=dst-nat chain=dstnat comment=VPN dst-port=1195 in-interface=
ether5-WAN_1 protocol=tcp to-addresses=192.0.0.23 to-ports=1195
add action=dst-nat chain=dstnat comment=AR-GoogleSheets dst-port=9899
in-interface=ether5-WAN_1 protocol=tcp to-addresses=192.0.0.222 to-ports=
80
add action=dst-nat chain=dstnat comment=OwnCloud dst-port=9998 in-interface=
ether5-WAN_1 log=yes log-prefix=222 protocol=tcp to-addresses=192.0.0.222
to-ports=9998
add action=dst-nat chain=dstnat comment=Spider dst-port=9696 in-interface=
ether5-WAN_1 protocol=tcp to-addresses=192.0.0.222 to-ports=80
/ip route
add disabled=no distance=1 dst-address=192.168.10.0/24 gateway=192.168.15.2
routing-table=main scope=30 suppress-hw-offload=no target-scope=10
add comment=Wateen disabled=no distance=1 dst-address=0.0.0.0/0 gateway=
123.123.123.201 routing-table=main scope=30 suppress-hw-offload=no
target-scope=10
add comment=WAN1 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=
123.123.123.201 routing-table=To_WAN1 scope=30 suppress-hw-offload=no
target-scope=10
add comment=PTCL disabled=yes distance=1 dst-address=0.0.0.0/0 gateway=
192.168.200.1 routing-table=main scope=30 suppress-hw-offload=no
target-scope=10
add comment=WAN2 disabled=yes distance=1 dst-address=0.0.0.0/0 gateway=
192.168.200.1 routing-table=To_WAN2 scope=30 suppress-hw-offload=no
target-scope=10
add comment=VPN disabled=no distance=1 dst-address=0.0.0.0/0 gateway=
123.123.200.249 routing-table=main scope=30 suppress-hw-offload=no
target-scope=10
add comment=WAN3 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=
123.123.200.249 routing-table=To_WAN3 scope=30 suppress-hw-offload=no
target-scope=10
/tool netwatch
add comment=Wateen disabled=no down-script=“/ip route disable [find comment="
Wateen"]\r
\n/ip route disable [find comment="WAN1"]\r
\n/tool e-mail send to="noc@tlpk.com" subject="Your Wateen-Internet Lin
k is Down" body="Your Wateen-Internet Link is Down. Please check. "”
host=123.123.123.201 http-codes=“” interval=30s start-delay=0ms
startup-delay=0s test-script=“” timeout=1s type=simple up-script=“/ip rout
e enable [find comment="Wateen"]\r
\n/ip route enable [find comment="WAN1"]\r
\n/tool e-mail send to="noc@tlpk.com" subject="Your Wateen-Internet Lin
k is Up" body="Your Wateen-Internet Link is Up. "”
add comment=PTCL disabled=no down-script=“/ip route disable [find comment="PT
CL"]\r
\n/ip route disable [find comment="WAN2"]\r
\n/tool e-mail send to="noc@tlpk.com" subject="Your PTCL-Internet Link
is Down" body="Your PTCL-Internet Link is Down. Please check. "” host=
181.191.111.43 http-codes=“” interval=30s start-delay=0ms startup-delay=
0s test-script=“” timeout=1s type=simple up-script=“/ip route enable [find
_comment="PTCL"]\r
\n/ip route enable [find comment="WAN2"]\r
\n/tool e-mail send to="noc@tlpk.com" subject="Your PTCL-Internet Link
is Up" body="Your PTCL-Internet Link is Up. "”
add comment=“VPN Link” disabled=no down-script=“/tool e-mail send to="noc@tlp
k.com" subject="Your VPN Link is Down" body="Your VPN Link is Down. Pl
ease check. "” host=123.123.200.249 http-codes=“” interval=30s
start-delay=0ms startup-delay=0s test-script=“” timeout=1s type=simple
up-script=“/tool e-mail send to="noc@tlpk.com" subject="Your VPN Link i
s UP" body="Your VPN Link is Up now."”
add comment=“AMG Link” disabled=no down-script=“/tool e-mail send to="noc@tlp
k.com" subject="Your AMG Link is Down" body="Your AMG Link is Down. Pl
ease check. "” host=192.168.10.1 http-codes=“” interval=30s start-delay=
0ms startup-delay=0s test-script=“” timeout=1s type=simple up-script=“/too
l e-mail send to="noc@tlpk.com" subject="Your AMG Link is UP" body="Y
our AMG Link is Up now."”