Community discussions

MikroTik App
 
HCraven
just joined
Topic Author
Posts: 4
Joined: Sun Jan 22, 2012 7:53 am

Firewall - Block RDP access to server EXCEPT form a single I

Sun Jan 22, 2012 8:22 am

I Can't seem to get this to work.
What is the firewall rule to Bock ALL RDP ( Port 3389 ) access to the internal server on 192.168.0.x EXCEPT from 101.0.0.1 ?
There is one internal connection ( LAN1 ) and two external Connections ( WAN 1 and WAN 2 ) to separate Routers / ISPs.

TIA
 
tjc
Member Candidate
Member Candidate
Posts: 276
Joined: Sun Jul 10, 2011 3:08 am

Re: Firewall - Block RDP access to server EXCEPT form a sing

Sun Jan 22, 2012 5:29 pm

You need two rules. The first one does an accept and allows only the permitted IP to access the RDP port, the second one does a drop for anything else going to the RDP port. Struggling to find a single rule to do something usually means that you need two or more, and sometimes even a side chain to simplify things.
 
ditonet
Forum Veteran
Forum Veteran
Posts: 835
Joined: Mon Oct 19, 2009 12:52 am
Location: Europe/Poland/Konstancin-Jeziorna
Contact:

Re: Firewall - Block RDP access to server EXCEPT form a sing

Sun Jan 22, 2012 6:35 pm

One NAT rule is enough:
/ip firewall nat
add action=dst-nat chain=dstnat comment="RDP" disabled=no dst-port=3389 in-interface=WAN protocol=tcp src-address=101.0.0.1 to-addresses=192.168.0.x to-ports=3389
HTH,
Last edited by ditonet on Mon Jan 23, 2012 2:27 am, edited 1 time in total.
 
HCraven
just joined
Topic Author
Posts: 4
Joined: Sun Jan 22, 2012 7:53 am

Re: Firewall - Block RDP access to server EXCEPT form a sing

Sun Jan 22, 2012 7:56 pm

Thanks.
Digging into the setup of this router further i see that WAN 1 is bridged. would this be why the rules aren't applying ?
 
HCraven
just joined
Topic Author
Posts: 4
Joined: Sun Jan 22, 2012 7:53 am

Re: Firewall - Block RDP access to server EXCEPT form a sing

Sun Jan 22, 2012 7:57 pm

But can't one simply use a bang (!) to say Drop where IP NOT = 101.0.0.1 ?
Surely that's simpler.
 
ditonet
Forum Veteran
Forum Veteran
Posts: 835
Joined: Mon Oct 19, 2009 12:52 am
Location: Europe/Poland/Konstancin-Jeziorna
Contact:

Re: Firewall - Block RDP access to server EXCEPT form a sing

Mon Jan 23, 2012 1:10 am

This rule states that RDP Dst-NAT is possible only when src-address is 101.0.0.1,
for other addresses it doesn't work, that's all.

HTH,
 
HCraven
just joined
Topic Author
Posts: 4
Joined: Sun Jan 22, 2012 7:53 am

Re: Firewall - Block RDP access to server EXCEPT form a sing

Mon Jan 23, 2012 1:38 am

Thanks. I do understand the rule.
( My reference to the Bang was in reply to the first responders message about two rules )

Who is online

Users browsing this forum: Bing [Bot] and 76 guests