Приветствую, коллеги!
Ломаю голову над вот какой задачей:
Разрешить сетевую активность (понимается хождение IP трафика и ARP пакетов) только от заранее определённого IP адреса, привязанного к конкретному порту.
Для данной цели, мы инспектим, соотв., два типа пакетов:
0x0806 - ARP
0x0800 - IP
По сути, PCF требуется только для ARP фильтра, для IP же фильтра можно просто пользоватся IP-профилем. К примеру:
Код:
create access_profile ip source_ip_mask 255.255.255.255 destination_ip_mask 0.0.0.0 profile_id 50
config access_profile profile_id 50 add access_id 1 ip source_ip 10.10.1.2 destination_ip 0.0.0.0 port 1 permit
Структура правил:
- разрешаем ARP
- разрешаем IP
- блокируем всё, что не разрешилось, например конструкцией
Код:
create access_profile ethernet source_mac 00-00-00-00-00-00 profile_id 100
config access_profile profile_id 100 add access_id 1 ethernet source_mac 00-00-00-00-00-00 port 1-24 deny
или
Код:
create access_profile packet_content_mask source_mac 00-00-00-00-00-00 profile_id 100
config access_profile profile_id 100 add access_id 1 packet_content source_mac 00-00-00-00-00-00 port 1-24 deny
Итак, гвоздь программы именно permit PCF правило для ARP пакетов в формате DES-3200-26.
Соответственно, прочитав FAQ, родим следующую конструкцию:
Код:
create access_profile packet_content_mask offset1 l2 0 0xffff offset2 l3 0 0xffff offset3 l3 2 0xffff offset4 l3 14 0xffff offset5 l3 16 0xffff profile_id 19
config access_profile profile_id 19 add access_id 1 packet_content offset1 0x0806 offset2 0x0001 offset3 0x0800 offset4 0xaaaa offset5 0xaaaa port 1 permit
где aaaaaa - IP адрес клиента
Ткните, пожалста, носом, где неправильно, ибо данная конструкция не работает.
ARP фильтруются запрещающим правилом, ибо, как я понимаю, profile id 19 не срабатывает.
Причём, что самое забавное, не разрешается вообще любые ARP, которые должны подпадать под правило:
Код:
create access_profile packet_content_mask offset1 l2 0 0xffff profile_id 19
config access_profile profile_id 19 add access_id 1 packet_content offset1 0x0806 port 1 permit
соотв.
Код:
Command: show switch
Device Type : DES-3200-26 Fast Ethernet Switch
Boot PROM Version : Build 1.00.B004
Firmware Version : Build 1.33.B004
Hardware Version : A1
System Name : test-dlink
System Location : admin`s room
Spanning Tree : Enabled
GVRP : Disabled
IGMP Snooping : Disabled
VLAN Trunk : Disabled
802.1X : Disabled
Telnet : Enabled (TCP 23)
Web : Disabled
RMON : Disabled
SSH : Disabled
SSL : Disabled
CLI Paging : Enabled
Syslog Global State: Enabled
Dual Image : Supported
Password Encryption Status : Enabled