• MikroTik.com
  • RouterBOARD
  • User Meeting
  • Training
  • User Manual
  • Support
  • Downloads
  • Videos
Register |   * Login | HOME

View unanswered posts | View active topics

Can bridge be used as firewall, and if so, how?  Page 1 of 1
 [ 8 posts ]  Post new topic Reply to topic
  Print view Previous topic | Next topic 
Author Message
eugenevdm
 Post subject: Can bridge be used as firewall, and if so, how?
PostPosted: Thu Jan 26, 2012 9:59 am 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Tue Jun 01, 2004 11:23 am
Posts: 195
Karma: 0

Location: Stellenbosch, South Africa
We have this setup:

Internet
|
Core Router
|
MikroTik (Transparent) Bridge
|
Windows 2008 Server with RDP

On MT Bridge, we have this rule:

/ip firewall filter chain=forward action=drop protocol=tcp dst-address=196.x.x.x dst-port=!3389

The idea is that all packets from the outside except RDP (port 3389) is dropped.

The rule fails because it's a bridge and now any traffic originating from the RDP server is also dropped.

How can we do this?

_________________
The Snowball Effect
Superior Internet Solutions


Top
 Profile  
 
Aug
 Post subject: Re: Can bridge be used as firewall, and if so, how?
PostPosted: Thu Jan 26, 2012 12:04 pm 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Thu Jun 07, 2007 1:10 am
Posts: 283
Karma: 4
bridge > settings > use ip firewall

_________________
Aug


Top
 Profile  
 
eugenevdm
 Post subject: Re: Can bridge be used as firewall, and if so, how?
PostPosted: Thu Jan 26, 2012 12:35 pm 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Tue Jun 01, 2004 11:23 am
Posts: 195
Karma: 0

Location: Stellenbosch, South Africa
>bridge > settings > use ip firewall

Already done, doesn't work.

Because bridge has no src interface or dst interface, all traffic is just "bridge".

Sure traffic gets in:

Internet Src->Firewall->OK @ 3389

but traffic also goes out

RDP Src->Firewall>Internet->Not OK because !3389 (TCP confirmations use random port)

_________________
The Snowball Effect
Superior Internet Solutions


Top
 Profile  
 
nickshore
 Post subject: Re: Can bridge be used as firewall, and if so, how?
PostPosted: Thu Jan 26, 2012 5:25 pm 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Thu Mar 03, 2005 4:14 pm
Posts: 286
Karma: 13

Location: Suffolk, UK.
should be a filter in bridge not ip firewall

eg

Quote:
/interface bridge filter
add action=drop chain=forward dst-address=192.168.55.0/24 dst-port=!3389 ip-protocol=tcp mac-protocol=ip

_________________
Nick Shore MTCNA MTCWE MTCRE MTCINE
LinITX.com - MultiThread Consultants
Get your MikroTik RBs and Training: http://linitx.com/category/166
Official UK MikroTik Distributor
IRC chan: #routerboard on irc.z.je (IPv4) or 6.irc.z.je (IPv6)


Top
 Profile  
 
Aug
 Post subject: Re: Can bridge be used as firewall, and if so, how?
PostPosted: Thu Jan 26, 2012 8:42 pm 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Thu Jun 07, 2007 1:10 am
Posts: 283
Karma: 4
yes you can use bridge filter also.

If you want to use ip firewall filter, I believe you need connection tracking enabled and bridge-settings-use ip firewall.

Either way should work.

_________________
Aug


Top
 Profile  
 
eugenevdm
 Post subject: Re: Can bridge be used as firewall, and if so, how?
PostPosted: Thu Jan 26, 2012 10:56 pm 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Tue Jun 01, 2004 11:23 am
Posts: 195
Karma: 0

Location: Stellenbosch, South Africa
Quote:
should be a filter in bridge not ip firewall


Thanks nickshore, I ended up doing this, to allow FTP and RDP and block everything else:

Code:
/interface bridge filter> pr

Flags: X - disabled, I - invalid, D - dynamic
 0   ;;; Accept ICMP for PING
     chain=forward action=accept mac-protocol=ip dst-address=196.x.x.x/32 ip-protocol=icmp

 1   ;;; Accept FTP Transfer Port
     chain=forward action=accept mac-protocol=ip dst-address=196.x.x.x/32 dst-port=20 ip-protocol=tcp

 2   ;;; Accept FTP Control Port
     chain=forward action=accept mac-protocol=ip dst-address=196.x.x.x/32 dst-port=21 ip-protocol=tcp

 3   ;;; Accept RDP
     chain=forward action=accept mac-protocol=ip dst-address=196.x.x.x/32 dst-port=3389 ip-protocol=tcp

 4   ;;; Log everything that is about to get dropped
     chain=forward action=log mac-protocol=ip dst-address=196.x.x.x/32 ip-protocol=tcp log-prefix="firewall_drop"

 5   ;;; Drop everything
     chain=forward action=drop mac-protocol=ip dst-address=196.x.x.x/32 ip-protocol=tcp


So far so good. I see some packets originating from the server to the outside on port 443, but nmap reports what I want to see, everything blocked except FTP.

_________________
The Snowball Effect
Superior Internet Solutions


Top
 Profile  
 
eugenevdm
 Post subject: Re: Can bridge be used as firewall, and if so, how?
PostPosted: Fri Jan 27, 2012 10:35 pm 
Offline
Member Candidate
Member Candidate
User avatar

Joined: Tue Jun 01, 2004 11:23 am
Posts: 195
Karma: 0

Location: Stellenbosch, South Africa
I confirm packets don't get out of the RDP server. I tried adding this rule:

Code:
;;; Allow everything out
     chain=forward action=accept mac-protocol=ip src-address=196.x.x.x/32 ip-protocol=tcp


Sure packets get out, but TCP/IP acknowledgements don't return.

Any advice?

_________________
The Snowball Effect
Superior Internet Solutions


Top
 Profile  
 
lahoras
 Post subject: Re: Can bridge be used as firewall, and if so, how?
PostPosted: Sat Apr 07, 2012 9:14 am 
Offline
newbie

Joined: Mon Aug 13, 2007 1:00 am
Posts: 39
Karma: 0

Location: Mendoza - Argentina
eugenevdm,i'm trying use firewall on bridge to block passthrough between wlans of my RB433, my case is similar because I want that windows customers can not access to other users that by default accidentaly have same group name and have any resource shared.

It was imposible for me makes that works, until I try this rule:

Code:

chain=forward action=drop mac-protocol=ip src-address=192.168.28.0/28  dst-port=135-139 ip-protocol=udp



If you wacht diference is adress, that is src and not dst, I was loging connections and here is the answer, src nated address has not the same port, in my case works fine now, can you check if this works on your net?

thanks in advance.

ARIEL


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 1
 [ 8 posts ] 

Board index » RouterOS » General

All times are UTC + 2 hours


Who is online

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


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Karma functions powered by Karma MOD © 2007, 2009 m157y