B
B
bruges2019-02-05 17:11:05
Mikrotik
bruges, 2019-02-05 17:11:05

Mirkotik are L7 rules correct?

Greetings! To block unwanted sites, I use this regular expression to mark DNS queries.

/ip firewall layer7-protocol
add name=badsites regexp="^.+(vk.com|fb.com|ok.ru).*\$"

The specified domains are successfully blocked, but along with them are domains that end in the same characters, for example: vo vk.com , htmlbo ok.ru . In theory, the problem should have been solved by replacing ^.+(with ^(, but no. Then the blocking stops working altogether.
I would be grateful for a hint on how to correctly compose a regular season?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Soslan Khloev, 2019-02-05
@hloe0xff

Try this.^https\?://(www.)\?(vk.com|fb.com|ok.ru).*\$

P
poisons, 2019-02-06
@poisons

Not the best solution, l7 percent is eating up noticeably. It's easier to add static dns records to unwanted domains pointing to 127.0.0.1.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question