Firewall rule - reject with exception for some IPs

Hello

Could you please tell me how should I set the firewall rule so that it would accept the connections to rdp port only for the specified address list and reject any other address that would try to connect to that port ?

thank you in advance for your comments

Jakub

You should start by reading the firewall manual: http://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Filter
You’re asking for very, very basic stuff.

First made an address list containing the IPs that can connect, then make a rule that permits those IPs, then drop all other traffic to the port. Assuming the RDP server is 1.1.1.1 and that 192.168.0.0/24 and 172.16.0.0/16 are allowed to connect:

/ip firewall address-list
add list=allowed-rdp address=192.168.0.0/24
add list=allowed-rdp address=172.16.0.0/16
/ip firewall filter
add chain=forward dst-address=1.1.1.1 protocol=tcp dst-port=3389 src-address-list=allowed-rdp action=accept
add chain=forward dst-address=1.1.1.1 protocol=tcp dst-port=3389 action=drop

Again, please search the wiki and forums for answers before posting - these are very basic things that are answered elsewhere already.

I often suspect that the missing clue most people new to filtering need is ruleS versus rule. You always need to think of a filter rule as only part of a set of rules which work together.

Once you internalize the notion of using multiple rules with exceptions (e.g. the accept above) followed by general (the drop) things get a lot clearer.

Hello

Thank you for your support. And I am also sorry for my basic questions, promise I will learn all that stuff asap and won`t write here these basics.)

J.