Помогите понять в чем ошибка.
Задача, настроить блокировку нежелательных сайтов с помощью L7 Filter. На данном этапе пока не маркирую соединения для дропа соединения и пакетов, а просто тестирую логику работы L7 Filter.
Имеем.
Маршрутизатор 951Ui-2nD. Прошивка Current 6.42.6
Настройка
Настройка выражения L7
Код: Выделить всё
/ip firewall layer7-protocol
add name=SocialBlock_L7 regexp="^.+(www.ok.ru|www.vk.com|www.fb.com|www.facebook.com).*\$"
На сайте mikrotik написано
L7 matcher collects the first 10 packets of a connection or the first 2KB of a connection and searches for the pattern in the collected data. If the pattern is not found in the collected data, the matcher stops inspecting further.
По логике, даже если правило L7 стоит после establish&related, то правило L7 все равно должно сработать при установке соединения (пока оно в статусе new) а дальше, не обращая внимания на establish&related собрать 10 пакетов или 2KB. Но... так оно не хочет работать =(
Вариант 1. рабочий.
Код: Выделить всё
add action=reject chain=forward comment="drop social L7 layer" layer7-protocol=SocialBlock_L7 protocol=tcp reject-with=tcp-reset
add action=drop chain=forward comment="Drop all invalid forward connections" connection-state=invalid
add action=accept chain=forward comment="Accept forward established and related connections" connection-state=established,related
Код: Выделить всё
add action=drop chain=forward comment="Drop all invalid forward connections" connection-state=invalid
add action=accept chain=forward comment="Accept forward established and related connections" connection-state=established,related
add action=reject chain=forward comment="drop social L7 layer" layer7-protocol=SocialBlock_L7 protocol=tcp reject-with=tcp-reset