Community discussions

MikroTik App
 
tyo100
just joined
Topic Author
Posts: 2
Joined: Tue Apr 30, 2013 6:47 pm

Multiwan portforward

Sun Oct 26, 2014 9:27 am

Hi, i have 3 wan i need forward tcp 22,25,80,443 to same host, i search the forum and apply what I saw, and delete all my settings and went back to start, I'm desperate not see one right answer, and have been back to do it all again, the connection starts but never gets to set always stays in mikrotik when i open the port 22 is always set mikrotik does not matter which wan comes. So guess there's no route back when the forward is enable, any suggestion is accepted.
 
bingo220
Member Candidate
Member Candidate
Posts: 124
Joined: Sun Sep 22, 2013 9:30 pm
Location: Ukraine

Re: Multiwan portforward

Sun Oct 26, 2014 12:31 pm

I haven't time to test.

ros code

/ip firewall mangle
add action=mark-packet chain=forward comment="Mark forward from WAN1 to Server" in-interface=wan1 protocol=tcp dst-port=22,25,80,443 new-packet-mark=w1-srv
add action=mark-packet chain=forward comment="Mark forward from WAN2 to Server" in-interface=wan2 protocol=tcp dst-port=22,25,80,443 new-packet-mark=w2-srv
add action=mark-packet chain=forward comment="Mark forward from WAN3 to Server" in-interface=wan3 protocol=tcp dst-port=22,25,80,443 new-packet-mark=w3-srv
add action=mark-routing chain=prerouting comment="Mark Route to WAN1" packet-mark=w1-srv new-routing-mark=static-wan1 passthrough=no
add action=mark-routing chain=prerouting comment="Mark Route to WAN2" packet-mark=w2-srv new-routing-mark=static-wan2 passthrough=no
add action=mark-routing chain=prerouting comment="Mark Route to WAN3" packet-mark=w3-srv new-routing-mark=static-wan3 passthrough=no
/ip route
add comment="Static Route to WAN1" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wan1 routing-mark=static-wan1 scope=255 target-scope=10
add comment="Static Route to WAN2" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wan2 routing-mark=static-wan2 scope=255 target-scope=10
add comment="Static Route to WAN3" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=wan3 routing-mark=static-wan3 scope=255 target-scope=10
 
tyo100
just joined
Topic Author
Posts: 2
Joined: Tue Apr 30, 2013 6:47 pm

Re: Multiwan portforward

Sun Oct 26, 2014 8:36 pm

Thnx for reply, i apply your settings, in the mikrotik the connections still in syn received never return anything and remote client receive timeout
, suggests?
You do not have the required permissions to view the files attached to this post.
 
itmethod
newbie
Posts: 34
Joined: Tue Feb 18, 2014 8:44 pm

Re: Multiwan portforward

Mon Oct 27, 2014 12:48 am

in combination with the config given above. you will need 3 port forward rules per port you want forwarded.
/ip firewall nat
add action=masquerade chain=srcnat comment="Wan1 outbound traffic" out-interface=\
    wan1
add action=masquerade chain=srcnat comment="Wan2 outbound traffic" out-interface=\
    wan2
add action=masquerade chain=srcnat comment="Wan3 outbound traffic" out-interface=\
    wan3
add action=dst-nat chain=dstnat comment="web server in Wan1" dst-port=80 \
    in-interface=wan1 protocol=tcp to-addresses=172.20.x.y \
    to-ports=80
add action=dst-nat chain=dstnat comment="web server in Wan2" dst-port=80 \
    in-interface=wan2 protocol=tcp to-addresses=172.20.x.y \
    to-ports=80
add action=dst-nat chain=dstnat comment="web server in Wan3" dst-port=80 \
    in-interface=wan3 protocol=tcp to-addresses=172.20.x.y \
    to-ports=80

Who is online

Users browsing this forum: No registered users and 44 guests