Router switch Firewall

Hello?
I need to implement firewall on router switch.
Rule is simple. Accept packets with dst address 192.168.1.5 with port number 502 and reject rest of packets.
How do I implement reject rest of packets with web interface?

Block all, except IP address and port number on the forward chain.

Are you really sure that is what you are trying to accomplish? Because with this rule all packages are dropped (except the exception).

This sounds like a port forwarding issue in terms of router speak, where the user wants to allow incoming requests on the internet reach a server within the LAN.
Note default firewall rules automatically block all WAN to LAN traffic but allow Destination NAT as you described.
It is up to the admin to then enter the appropriate NAT rule to allow that traffic.
In summary, already done, you just need a dst nat rule.

As seen by the previous post however your description is sufficiently vague and thus clearer direction is not possible and there is no guarantee that your issues are resolved.