faq обучение настройка
Текущее время: Вс июн 29, 2025 10:42

Часовой пояс: UTC + 3 часа




Начать новую тему Ответить на тему  [ Сообщений: 22 ]  На страницу Пред.  1, 2
Автор Сообщение
 Заголовок сообщения: Re: ACL
СообщениеДобавлено: Ср мар 09, 2016 16:18 
Не в сети

Зарегистрирован: Сб янв 12, 2013 01:09
Сообщений: 37
В общем у меня получилось вот такой набор правил

1) стандартным Ethernet ACL разрешаем ARP на всех портах (Ethernet Type 806 )
2) стандартным IP ACL разрешаем запроcы к dhcp (Protocol UDP-- dest port:67 )
Protocol UDP-- dest port:67
3) Packet Content ACL разрешаем такой-то IP+MAC+VLAN на порту

Offset 0-15 0x00000000 0x0000FFFF 0xFFFFFFFF 0xFFFF0FFF
Offset 16-31 0x00000000 0x00000000 0x00000000 0x0000FFFF
Offset 32-47 0xFFFF0000 0x00000000 0x00000000 0x00000000
Offset 48-63 0x00000000 0x00000000 0x00000000 0x00000000
Offset 64-79 0x00000000 0x00000000 0x00000000 0x00000000

и само правило

Content Item1 Offset : 6 Value : 0x001A791B
Content Item2 Offset : 10 Value : 0x66418100
Content Item3 Offset : 14 Value : 0x00500000
Content Item4 Offset : 30 Value : 0xC0A81D08

есть правда ощущение что в маске для vlan что-то неверно. но на стенде работает.
vlan 80
ip 192.168.29.8

ну и последним Ethernet ACL рубим всё остальное

Profile ID 240
Access ID 1
Actions Deny
Type Ethernet
VLAN Name MTV_NET


Вернуться наверх
 Профиль  
 
 Заголовок сообщения: Re: ACL
СообщениеДобавлено: Ср мар 09, 2016 17:55 
Не в сети

Зарегистрирован: Вс дек 21, 2008 18:53
Сообщений: 1308
Сами команды какие? Так удобнее воспринимать.

p.s. MAC, по возможности, надо игнорировать где только можно, если явно не стоит обратная задача (т.е. когда именно ТРЕБУЕТСЯ учитывать его).

_________________
D-Link Switches: Tips & Tricks


Вернуться наверх
 Профиль  
 
 Заголовок сообщения: Re: ACL
СообщениеДобавлено: Ср мар 09, 2016 20:00 
Не в сети

Зарегистрирован: Сб янв 12, 2013 01:09
Сообщений: 37
create access_profile ethernet ethernet_type profile_id 10
config access_profile profile_id 10 add access_id 1 ethernet ethernet_type 0x806 port 1-52 permit rx_rate no_limit

create access_profile ip udp dst_port 0xFFFF profile_id 15
config access_profile profile_id 15 add access_id 1 ip udp dst_port 67 port 1-52 permit rx_rate no_limit

create access_profile packet_content offset_0-15 0x0 0xffff 0xffffffff 0xffff0fff offset_16-31 0x0 0x0 0x0 0xffff offset_32-47 0xffff0000 0x0 0x0 0x0 profile_id 21
config access_profile profile_id 21 add access_id 1 packet_content offset 6 0x1a791b offset 10 0x66418100 offset 14 0x620000 offset 30 0xc0a81d08 port 3 permit rx_rate no_limit

create access_profile ethernet vlan profile_id 240
config access_profile profile_id 240 add access_id 1 ethernet vlan MTV_NET port 3 deny


В принципе да. Мак тут явно избыточен. IP+VLAN самое нужное тут.


Вернуться наверх
 Профиль  
 
 Заголовок сообщения: Re: ACL
СообщениеДобавлено: Чт мар 10, 2016 16:05 
Не в сети

Зарегистрирован: Сб янв 12, 2013 01:09
Сообщений: 37
Не видно ли со стороны каких либо ошибок?


Вернуться наверх
 Профиль  
 
 Заголовок сообщения: Re: ACL
СообщениеДобавлено: Пн мар 14, 2016 14:39 
Не в сети

Зарегистрирован: Вс дек 21, 2008 18:53
Сообщений: 1308
stalker86 писал(а):
Не видно ли со стороны каких либо ошибок?

В данной схеме видно, что возможен ARP-spoofing. Абонент может отравить ARP-кеш абонента или шлюза (кроме случаев когда влан на абонента). Потому arp я тоже контролирую ACL'ками.

Еще, насчет VLAN, если я правильно припоминаю, то на позиции 12 будет уже ether type, а метка 802.1q отсутствует в принципе. То есть фильтровать входящий трафик по vlan с абонентов нельзя. По причине отсутствия там признака vlan.

_________________
D-Link Switches: Tips & Tricks


Последний раз редактировалось xcme Пн мар 14, 2016 14:47, всего редактировалось 1 раз.

Вернуться наверх
 Профиль  
 
 Заголовок сообщения: Re: ACL
СообщениеДобавлено: Пн мар 14, 2016 14:41 
Не в сети

Зарегистрирован: Сб янв 12, 2013 01:09
Сообщений: 37
А пример Ваших arp правил можете показать?


Вернуться наверх
 Профиль  
 
 Заголовок сообщения: Re: ACL
СообщениеДобавлено: Пн мар 14, 2016 14:55 
Не в сети

Зарегистрирован: Вс дек 21, 2008 18:53
Сообщений: 1308
stalker86 писал(а):
А пример Ваших arp правил можете показать?


Код:
#allow traffic for specified ports
create access_profile ethernet source_mac 00-00-00-00-00-00 profile_id 1
#to manually allow any traffic for port X add following rule:
#config access_profile profile_id 1 add access_id auto_assign ethernet source_mac 00-00-00-00-00-00 port X permit

#allow tagged frames
create access_profile packet_content_mask offset_0-15 0x0 0x0 0x0 0xffff0000 profile_id 2
config access_profile profile_id 2 add access_id auto_assign packet_content offset 12 0x81000000 port all permit

#deny networks 172.17.0.0/16 and 10.99.0.0/16 for subscribers
create access_profile packet_content_mask offset_0-15 0x0 0x0 0x0 0xffff0000 offset_16-31 0x0 0x0 0x0 0xffff profile_id 3
config access_profile profile_id 3 add access_id auto_assign packet_content offset 12 0x08000000 offset 28 0xac11 port 1-24 deny
config access_profile profile_id 3 add access_id auto_assign packet_content offset 12 0x08000000 offset 28 0x0a63 port 1-24 deny

#allow individual source network for a specific subscriber. (!) this rule applies only to untagged traffic
create access_profile packet_content_mask offset_0-15 0x0 0x0 0x0 0xffff0000 offset_16-31 0x0 0x0 0xffff 0xfef80000 profile_id 5
config access_profile profile_id 5 add access_id auto_assign packet_content offset 12 0x08000000 offset 24 0x0aXX offset 28 0xYY080000 port   1 permit
config access_profile profile_id 5 add access_id auto_assign packet_content offset 12 0x08000000 offset 24 0x0aXX offset 28 0xYY100000 port   2 permit
...

#permit ARP with correct 4th octet (between port*8 and port*8+7). (!) these rules applies only to untagged traffic
create access_profile packet_content_mask offset_0-15 0x0 0x0 0x0 0xffff0000 offset_16-31 0x0 0x0 0x0 0xf8 profile_id 6
config access_profile profile_id 6 add access_id auto_assign packet_content offset 12 0x08060000 offset 28 0x08 port  #1 permit
config access_profile profile_id 6 add access_id auto_assign packet_content offset 12 0x08060000 offset 28 0x10 port  #2 permit
...

#DSCP mapping on valid multicast groups
create access_profile ip dscp profile_id 7
config access_profile profile_id 7 add access_id auto_assign ip dscp 48 port 25 permit priority 6

#deny multicast from subscribers. (!) this rule applies only to untagged traffic
create access_profile packet_content_mask offset_0-15 0x0 0x0 0x0 0xffff0000 offset_16-31 0x0 0x0 0x0 0x0000f000 profile_id 8
config access_profile profile_id 8 add access_id auto_assign packet_content offset 12 0x08000000 offset 28 0x0000e000 port 1-24 deny

#deny ARP (optional), IP (optional) and broadcast. permit IPv6. deny unknown ethernet. (for subscribers)
create access_profile ethernet source_mac 00-00-00-00-00-00 destination_mac FF-FF-FF-FF-FF-FF ethernet_type profile_id 9
config access_profile profile_id 9 add access_id auto_assign ethernet ethernet_type 0x0806 port 1-24 deny
config access_profile profile_id 9 add access_id auto_assign ethernet ethernet_type 0x0800 port 1-24 deny

config access_profile profile_id 9 add access_id auto_assign ethernet destination_mac FF-FF-FF-FF-FF-FF port 1-24 deny
config access_profile profile_id 9 add access_id auto_assign ethernet ethernet_type 0x86dd port 1-24 permit
config access_profile profile_id 9 add access_id auto_assign ethernet source_mac 00-00-00-00-00-00 port -124 deny


IP-сети разрешаются по принципу 10.128.4-5.8-15 или 10.143.8-9.80-87. То есть в 3-м октете 2 числа, а в 4-м - 8. Сети у меня на абонента с маской /29 и "плавающим" третьим октетом.
В ARP проверяется только 4-й октет.

То есть XX в правилах - это второй октет, а YY - третий. А совпадение с третьим и четвертым обеспечивается прерывающейся маской 0xfef80000.

_________________
D-Link Switches: Tips & Tricks


Вернуться наверх
 Профиль  
 
Показать сообщения за:  Сортировать по:  
Начать новую тему Ответить на тему  [ Сообщений: 22 ]  На страницу Пред.  1, 2

Часовой пояс: UTC + 3 часа


Кто сейчас на форуме

Сейчас этот форум просматривают: Google [Bot] и гости: 54


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Перейти:  
Создано на основе phpBB® Forum Software © phpBB Group
Русская поддержка phpBB