Page 1 of 1

Firewall - Layer7 - Regular Expression

Posted: Thu Jul 23, 2015 8:07 pm
by leandro1504
Dear,

     I'm trying to accomplish a lock using the mikrotik's Layer7 firewall, but I cannot, following settings:
/ IP-protocol firewall Layer7
add name = teste_url regexp = "^. + (teste.com.br/servicos.html).*\$"

/ ip firewall filter
add chain = forward comment = "Allow access only to URL informed Layer7" Layer7-protocol = teste_url
add action = drop chain = forward comment = "Locks all the rest"

[/ code]

My goal is to allow access to only the URL that contains * teste.com.br/servicos.html *, but if he tries to access teste.com.br will not get.

I tried to carry out this setting, but it still fails.

Anyone have any suggestions?

I am performing this test on a RB750 version 6.29.1

Re: Firewall - Layer7 - Regular Expression

Posted: Fri Jul 24, 2015 2:16 pm
by UMarcus
May be ^.*test.com.br/servicos.html.*

But i'm not sure if you need to escape some characters for example the '/'

Re: Firewall - Layer7 - Regular Expression

Posted: Fri Jul 24, 2015 4:03 pm
by leandro1504
thanks for the reply, I did the tests and did not work, I believe it will take out the bar, but I have no knowledge of regex, you know how to do?

Re: Firewall - Layer7 - Regular Expression

Posted: Wed Sep 09, 2015 1:38 pm
by UMarcus
Sorry for beeing late ..

Escape yould be

'teste.com.br\/servicos.html'

May be you could replace it with a expression which says 'any character for once' like '.{1}'

'teste.com.br.{1}servicos.html'

Regrads
Marcus