Community discussions

MikroTik App
 
leandro1504
just joined
Topic Author
Posts: 7
Joined: Tue Apr 07, 2015 3:41 pm

Firewall - Layer7 - Regular Expression

Thu Jul 23, 2015 8:07 pm

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
 
UMarcus
Frequent Visitor
Frequent Visitor
Posts: 95
Joined: Wed Jan 21, 2015 10:11 am
Location: Europe

Re: Firewall - Layer7 - Regular Expression

Fri Jul 24, 2015 2:16 pm

May be ^.*test.com.br/servicos.html.*

But i'm not sure if you need to escape some characters for example the '/'
 
leandro1504
just joined
Topic Author
Posts: 7
Joined: Tue Apr 07, 2015 3:41 pm

Re: Firewall - Layer7 - Regular Expression

Fri Jul 24, 2015 4:03 pm

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?
 
UMarcus
Frequent Visitor
Frequent Visitor
Posts: 95
Joined: Wed Jan 21, 2015 10:11 am
Location: Europe

Re: Firewall - Layer7 - Regular Expression

Wed Sep 09, 2015 1:38 pm

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