Portforwarding UDP does not work....

Hello,

i’m new with Mikrotik routers, but i already have a Problem with a simple forward rule.

I’m forwarding port 24010 tcp → no problem, i can see the connections on the destination host with tcpdump.
Forwarding 54277 udp does not work at all. Can’t find the problem:

/ip firewall filter
add chain=forward dst-port=54277 protocol=udp
add chain=forward dst-port=24010 protocol=tcp
add action=drop chain=input comment=“Drop Invalid connections” connection-state=invalid in-interface=pppoe-out1
add action=drop chain=input comment=“Drop New connections” connection-state=new in-interface=pppoe-out1
add chain=input comment=“Allow Established connections” connection-state=established
add chain=input comment=“Allow related connections” connection-state=related
add chain=input in-interface=!ether1-gateway src-address=192.168.215.0/24
add action=drop chain=input comment=“Drop everything else”



/ip firewall nat
add action=masquerade chain=srcnat comment=“default configuration” disabled=yes out-interface=ether1-gateway to-addresses=0.0.0.0
add action=dst-nat chain=dstnat dst-port=54277 in-interface=pppoe-out1 protocol=udp to-addresses=192.168.215.4
add action=dst-nat chain=dstnat dst-port=24010 in-interface=pppoe-out1 protocol=tcp to-addresses=192.168.215.4

Maybe someone can help me.

Thanks!
Screen Shot 2014-04-04 at 16.56.19.png

Which version of ROS are you using?

6.11 on a RB750GL.

But i solved the problem already, but don’t know exactly why :wink:

I have these rules:

add chain=forward connection-state=new dst-address=xxxxxx dst-port=54277 in-interface=pppoe-out1 protocol=udp
add chain=forward connection-state=established dst-address=xxx dst-port=54277 in-interface=pppoe-out1 protocol=udp
add chain=forward connection-state=related dst-address=xxx dst-port=54277 in-interface=pppoe-out1 protocol=udp

add action=dst-nat chain=dstnat dst-port=54277 in-interface=pppoe-out1 protocol=udp to-addresses=192.168.x.x

And after a restart of the router, the packets are forwarded.

So if my suspicion is right:
Already active udp connections can’t be changed/forwarded to another host ?!

That may have been because their were connection states in the rules. Either way, I’m glad you were able to get it working :slight_smile: