forum.bitel.ru http://forum.bitel.ru/ |
|
D-Link + DHCP Opt.82 + Manad : Возможно ли ? http://forum.bitel.ru/viewtopic.php?f=7&t=5129 |
Страница 1 из 1 |
Автор: | barguzin2 [ 14 фев 2011, 20:58 ] |
Заголовок сообщения: | D-Link + DHCP Opt.82 + Manad : Возможно ли ? |
Нужно собрать такую схему - на свичах д-линк настроить dhcp_relay opt82, на них же блокировать пользователя в инет (кроме днс, статистики), через dhcp юзер с биллинга будеть получать IP, а скорость нужно резать на Linux-роутере. Как минимальными усилиями реализовать такую схему ? Перенести отключение на линукс - не предлагать, т.к. он стоит на выходе в инет, а при отключении нужно также блокировать локальные ресурсы, где магистрали по 10G, так что и туда PC-шейпер не поставишь. |
Автор: | stark [ 15 фев 2011, 10:23 ] |
Заголовок сообщения: | Re: D-Link + DHCP Opt.82 + Manad : Возможно ли ? |
Возможно ..сделайте 2 шлюза на договор dlink и manad.. Преком dlink-а будет dhcp |
Автор: | barguzin2 [ 15 фев 2011, 11:31 ] |
Заголовок сообщения: | Re: D-Link + DHCP Opt.82 + Manad : Возможно ли ? |
Спасибо, попробую. Так понимаю BGBilling стандартно по SNMP-ACL с D-Link 3028 не работает и нужно управлять свичами через скрипты из wiki ? |
Автор: | crez [ 15 фев 2011, 13:42 ] |
Заголовок сообщения: | Re: D-Link + DHCP Opt.82 + Manad : Возможно ли ? |
Сам долго бился с этой настройкой (свитчи ни в какую не хотели работать). После очередного обновления все вдруг заработало. Выкладываю данные прямо из биллинга: Код: Клиент: вер. 5.1 сборка 471 от 08.02.2011 03:50:04 os:Windows 7; java:Sun Microsystems Inc., v.1.6.0_20 Сервер: вер. 5.1 сборка 584 от 01.02.2011 11:16:52 os:Linux; java:Sun Microsystems Inc., v.1.6.0 ipn вер. 5.1 сборка 218 от 31.01.2011 15:32:00 Настройка для D-Link 3028 Закладка "Тип шлюза": D-Link 3028 Script Конфигурация: Код: user_rule.editor.class=bitel.billing.module.services.ipn.editor.DlinkContractRuleEditor gate_manager.class=bitel.billing.server.ipn.DlinkGateWorker use.script=1 Скрипт: Код: import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.StringTokenizer; import java.util.regex.Matcher; import java.util.regex.Pattern; import bitel.billing.common.IPUtils; import bitel.billing.common.module.ipn.IPNContractStatus; import bitel.billing.server.ipn.UserStatus; import bitel.billing.server.ipn.bean.ManadUtils; import bitel.billing.server.ipn.bean.VlanManager; import bitel.billing.server.ipn.dlink.UserPortStatus; import bitel.billing.server.util.DefaultServerSetup; import bitel.billing.server.util.Utils; import bitel.billing.server.util.telnet.TelnetSession; protected void doSync() { try { String host = gate.getHost(); int port = gate.getPort(); DefaultServerSetup gateSetup = new DefaultServerSetup( gate.getConfig(), "\r\n" ); String pswd = gate.getKeyword(); String login = gateSetup.getStringValue( "login"); StringBuffer result = new StringBuffer(); if( log.isDebugEnabled() ) { log.debug( gate.getId() + " gate: " + host + ":" + port + " login: " + login + " pswd: " + pswd ); } TelnetSession session = new TelnetSession( host, port); session.setLoginPromptSequence( ":" ); log.debug( "before connect" ); session.connect(); log.debug( "after connect" ); result.append( session.doCommand( login ) ); log.debug( "after command" ); session.setLoginPromptSequence( "#" ); result.append( session.doCommand( pswd ) ); log.debug( "before pswd" ); log.debug( "execute commands" ); doCommands( session, result, gateSetup); //TODO commands here session.setLoginPromptSequence( "****" ); result.append( session.doCommand( "logout" ) ); log.info( result.toString() ); log.debug( "ok" ); } catch (Exception e) { throw new RuntimeException ( e ); } } private void doCommands( TelnetSession session, StringBuffer result, DefaultServerSetup gateSetup) throws IOException { String openAddress = gateSetup.getStringValue( "open.address", "255.255.255.255" ) ; log.debug( "openAddress = " + openAddress ); uplinks = Utils.stringToIntegerList( gateSetup.getStringValue( "uplink" ) ); List ports = getUserList( statusList ); String [] openRules = new String [] { //Профиль 20 Разрешаем клиенту видеть мир // разрешающие правила добавляются с номером порта клиента "config access_profile profile_id 20 add access_id ${port} ip source_ip ${ip} destination_ip 0.0.0.0 port ${port} permit"}; String [] closeRules = new String [] { // Профиль 8 разрешаем клиенту видеть Стат+ДНС сервер // разрешающие правила добавляются с номером порта клиента "config access_profile profile_id 8 add access_id ${port} ip source_ip ${ip} destination_ip ${openAdress} port ${port} permit", //Профиль 12 Разрешаем ИП запросы на аплинках на адрес клиента со статистики "config access_profile profile_id 12 add access_id ${mod}${port} ip source_ip ${openAdress} destination_ip ${ip} port ${upport} permit", //16 Запрещаем ИП запросы на аплинках на адрес клиента "config access_profile profile_id 16 add access_id ${mod}${port} ip source_ip 0.0.0.0 destination_ip ${ip} port ${upport} deny"}; for( UserPortStatus port : ports ) { log.debug("port.ipAddr=" + port.ipAddr); //удаляюшие правила if ( port.status.status == IPNContractStatus.STATUS_REMOVED ) { int [] profiles = new int [] { 8, 20 }; for (int profile : profiles) { String rule = "config access_profile profile_id " + profile + " delete access_id " + port.port; log.debug("rule=" + rule); result.append( session.doCommand( rule ) ); } int [] profiles = new int [] { 12, 16 }; for (int profile : profiles) { for (int j = 0; j < uplinks.size(); j++) { Integer upport = uplinks.get(j); pref = j > 0 ? String.valueOf( j * 10 ) : ""; String rule = "config access_profile profile_id " + profile + " delete access_id " + pref + port.port; log.debug("rule=" + rule); result.append( session.doCommand( rule ) ); } } } else if ( port.status.status == IPNContractStatus.STATUS_OPEN ) { int [] profiles = new int [] { 8 }; for (int profile : profiles) { String rule = "config access_profile profile_id " + profile + " delete access_id " + port.port; log.debug("rule=" + rule); result.append( session.doCommand( rule ) ); } int [] profiles = new int [] { 12, 16 }; for (int profile : profiles) { for (int j = 0; j < uplinks.size(); j++) { Integer upport = uplinks.get(j); pref = j > 0 ? String.valueOf( j * 10 ) : ""; String rule = "config access_profile profile_id " + profile + " delete access_id " + pref + port.port; log.debug("rule=" + rule); result.append( session.doCommand( rule ) ); } } //20 rule = openRules[0]; rule = setValues( rule, port.port, port.ipAddr, openAddress, "" ); log.info("rule=" + rule); result.append( session.doCommand( rule ) ); } else //close { int [] profiles = new int [] { 20 }; for (int profile : profiles) { String rule = "config access_profile profile_id " + profile + " delete access_id " + port.port; log.debug("rule=" + rule); result.append( session.doCommand( rule ) ); } //8 rule = closeRules[0]; rule = setValues( rule, port.port, port.ipAddr, openAddress, "" ); log.info("rule=" + rule); result.append( session.doCommand( rule ) ); //12, 16 for (int j = 0; j < uplinks.size(); j++) { Integer upport = uplinks.get(j); for (int i = 1; i < 3; i++) { rule = closeRules[i]; rule = setValues( rule, port.port, port.ipAddr, openAddress, String.valueOf( upport ) ); rule = rule.replaceAll( "\\$\\{mod\\}" , String.valueOf( j * 10 ) ); log.info("rule=" + rule); result.append( session.doCommand( rule ) ); } } } } } private String setValues( String rule, int port, String ip, String openAddress, String upport ) { rule = rule.replaceAll( "\\$\\{port\\}", String.valueOf( port ) ); rule = rule.replaceAll( "\\$\\{ip\\}" , ip ); rule = rule.replaceAll( "\\$\\{openAdress\\}", openAddress ); rule = rule.replaceAll( "\\$\\{upport\\}", upport ); return rule; } protected void doParentSync() { } public List getUserList( List statusList ) { List userList = new ArrayList(); for( UserStatus status : statusList ) { String rule = status.rule.getRuleText(); StringTokenizer st = new StringTokenizer( rule, ";" ); while( st.hasMoreTokens() ) { String token = st.nextToken().trim(); data = token.split( ":" ); if( data.length == 2 ) { UserPortStatus portStatus = new UserPortStatus(); portStatus.port = Utils.parseIntString( data[0] ); portStatus.ipAddr = data[1]; portStatus.status = status; userList.add( portStatus ); } else if ( data.length == 3 ) { UserPortStatus portStatus = new UserPortStatus(); portStatus.port = Utils.parseIntString( data[0] ); portStatus.macAddr = data[1].toUpperCase().replaceAll( "\\-", " " ); portStatus.ipAddr = data[2]; portStatus.status = status; userList.add( portStatus ); } } } return userList; } Закладка "Шлюз": Конфигурация: Код: #Логин для DLink-а login=crez #Таймаут, если нужен #timeout=5000 #Родительский шлюз DHCP-IPN dhcp.router=10.49.64.20 #маска открытых серверов (куда юзверя пустит даже при отрицательном балансе - ЛК, сайт провайдера и т.д.) open.mask=255.255.255.248 #адрес открытого сервера open.address=91.199.153.0 #количество портов на свитче ports=28 #номера uplink портов (связь с другими коммутаторами) uplink=25,26,27,28 Хост и порт шлюза: 10.49.64.100 порт 23 Ключевое слово: ******* - пассворд для DLink-а (логин в Конфигурации) Тип шлюза: D-Link 3028 Script Подготовка самого свитча: Телнетимся и заливаем ему таблицу ACL (в таблице 248-я маска - та на которую пускаем при отрицательном балансе): Код: create access_profile ip destination_ip_mask 0.0.0.0 udp dst_port_mask 0xFFFF profile_id 4 config access_profile profile_id 4 add access_id 1 ip destination_ip 0.0.0.0 udp dst_port 67 port 1 permit config access_profile profile_id 4 add access_id 2 ip destination_ip 0.0.0.0 udp dst_port 67 port 2 permit config access_profile profile_id 4 add access_id 3 ip destination_ip 0.0.0.0 udp dst_port 67 port 3 permit config access_profile profile_id 4 add access_id 4 ip destination_ip 0.0.0.0 udp dst_port 67 port 4 permit config access_profile profile_id 4 add access_id 5 ip destination_ip 0.0.0.0 udp dst_port 67 port 5 permit config access_profile profile_id 4 add access_id 6 ip destination_ip 0.0.0.0 udp dst_port 67 port 6 permit config access_profile profile_id 4 add access_id 7 ip destination_ip 0.0.0.0 udp dst_port 67 port 7 permit config access_profile profile_id 4 add access_id 8 ip destination_ip 0.0.0.0 udp dst_port 67 port 8 permit config access_profile profile_id 4 add access_id 9 ip destination_ip 0.0.0.0 udp dst_port 67 port 9 permit config access_profile profile_id 4 add access_id 10 ip destination_ip 0.0.0.0 udp dst_port 67 port 10 permit config access_profile profile_id 4 add access_id 11 ip destination_ip 0.0.0.0 udp dst_port 67 port 11 permit config access_profile profile_id 4 add access_id 12 ip destination_ip 0.0.0.0 udp dst_port 67 port 12 permit config access_profile profile_id 4 add access_id 13 ip destination_ip 0.0.0.0 udp dst_port 67 port 13 permit config access_profile profile_id 4 add access_id 14 ip destination_ip 0.0.0.0 udp dst_port 67 port 14 permit config access_profile profile_id 4 add access_id 15 ip destination_ip 0.0.0.0 udp dst_port 67 port 15 permit config access_profile profile_id 4 add access_id 16 ip destination_ip 0.0.0.0 udp dst_port 67 port 16 permit config access_profile profile_id 4 add access_id 17 ip destination_ip 0.0.0.0 udp dst_port 67 port 17 permit config access_profile profile_id 4 add access_id 18 ip destination_ip 0.0.0.0 udp dst_port 67 port 18 permit config access_profile profile_id 4 add access_id 19 ip destination_ip 0.0.0.0 udp dst_port 67 port 19 permit config access_profile profile_id 4 add access_id 20 ip destination_ip 0.0.0.0 udp dst_port 67 port 20 permit config access_profile profile_id 4 add access_id 21 ip destination_ip 0.0.0.0 udp dst_port 67 port 21 permit config access_profile profile_id 4 add access_id 22 ip destination_ip 0.0.0.0 udp dst_port 67 port 22 permit config access_profile profile_id 4 add access_id 23 ip destination_ip 0.0.0.0 udp dst_port 67 port 23 permit config access_profile profile_id 4 add access_id 24 ip destination_ip 0.0.0.0 udp dst_port 67 port 24 permit create access_profile ip source_ip_mask 255.255.255.255 destination_ip_mask 255.255.255.248 profile_id 8 create access_profile ip source_ip_mask 255.255.255.248 destination_ip_mask 255.255.255.255 profile_id 12 create access_profile ip destination_ip_mask 255.255.255.255 profile_id 16 create access_profile ip source_ip_mask 255.255.255.255 profile_id 20 create access_profile ethernet ethernet_type profile_id 24 config access_profile profile_id 24 add access_id 1 ethernet ethernet_type 0x806 port 1 permit config access_profile profile_id 24 add access_id 2 ethernet ethernet_type 0x806 port 2 permit config access_profile profile_id 24 add access_id 3 ethernet ethernet_type 0x806 port 3 permit config access_profile profile_id 24 add access_id 4 ethernet ethernet_type 0x806 port 4 permit config access_profile profile_id 24 add access_id 5 ethernet ethernet_type 0x806 port 5 permit config access_profile profile_id 24 add access_id 6 ethernet ethernet_type 0x806 port 6 permit config access_profile profile_id 24 add access_id 7 ethernet ethernet_type 0x806 port 7 permit config access_profile profile_id 24 add access_id 8 ethernet ethernet_type 0x806 port 8 permit config access_profile profile_id 24 add access_id 9 ethernet ethernet_type 0x806 port 9 permit config access_profile profile_id 24 add access_id 10 ethernet ethernet_type 0x806 port 10 permit config access_profile profile_id 24 add access_id 11 ethernet ethernet_type 0x806 port 11 permit config access_profile profile_id 24 add access_id 12 ethernet ethernet_type 0x806 port 12 permit config access_profile profile_id 24 add access_id 13 ethernet ethernet_type 0x806 port 13 permit config access_profile profile_id 24 add access_id 14 ethernet ethernet_type 0x806 port 14 permit config access_profile profile_id 24 add access_id 15 ethernet ethernet_type 0x806 port 15 permit config access_profile profile_id 24 add access_id 16 ethernet ethernet_type 0x806 port 16 permit config access_profile profile_id 24 add access_id 17 ethernet ethernet_type 0x806 port 17 permit config access_profile profile_id 24 add access_id 18 ethernet ethernet_type 0x806 port 18 permit config access_profile profile_id 24 add access_id 19 ethernet ethernet_type 0x806 port 19 permit config access_profile profile_id 24 add access_id 20 ethernet ethernet_type 0x806 port 20 permit config access_profile profile_id 24 add access_id 21 ethernet ethernet_type 0x806 port 21 permit config access_profile profile_id 24 add access_id 22 ethernet ethernet_type 0x806 port 22 permit config access_profile profile_id 24 add access_id 23 ethernet ethernet_type 0x806 port 23 permit config access_profile profile_id 24 add access_id 24 ethernet ethernet_type 0x806 port 24 permit create access_profile ethernet source_mac 00-00-00-00-00-00 profile_id 28 config access_profile profile_id 28 add access_id 1 ethernet source_mac 00-00-00-00-00-00 port 1 deny config access_profile profile_id 28 add access_id 2 ethernet source_mac 00-00-00-00-00-00 port 2 deny config access_profile profile_id 28 add access_id 3 ethernet source_mac 00-00-00-00-00-00 port 3 deny config access_profile profile_id 28 add access_id 4 ethernet source_mac 00-00-00-00-00-00 port 4 deny config access_profile profile_id 28 add access_id 5 ethernet source_mac 00-00-00-00-00-00 port 5 deny config access_profile profile_id 28 add access_id 6 ethernet source_mac 00-00-00-00-00-00 port 6 deny config access_profile profile_id 28 add access_id 7 ethernet source_mac 00-00-00-00-00-00 port 7 deny config access_profile profile_id 28 add access_id 8 ethernet source_mac 00-00-00-00-00-00 port 8 deny config access_profile profile_id 28 add access_id 9 ethernet source_mac 00-00-00-00-00-00 port 9 deny config access_profile profile_id 28 add access_id 10 ethernet source_mac 00-00-00-00-00-00 port 10 deny config access_profile profile_id 28 add access_id 11 ethernet source_mac 00-00-00-00-00-00 port 11 deny config access_profile profile_id 28 add access_id 12 ethernet source_mac 00-00-00-00-00-00 port 12 deny config access_profile profile_id 28 add access_id 13 ethernet source_mac 00-00-00-00-00-00 port 13 deny config access_profile profile_id 28 add access_id 14 ethernet source_mac 00-00-00-00-00-00 port 14 deny config access_profile profile_id 28 add access_id 15 ethernet source_mac 00-00-00-00-00-00 port 15 deny config access_profile profile_id 28 add access_id 16 ethernet source_mac 00-00-00-00-00-00 port 16 deny config access_profile profile_id 28 add access_id 17 ethernet source_mac 00-00-00-00-00-00 port 17 deny config access_profile profile_id 28 add access_id 18 ethernet source_mac 00-00-00-00-00-00 port 18 deny config access_profile profile_id 28 add access_id 19 ethernet source_mac 00-00-00-00-00-00 port 19 deny config access_profile profile_id 28 add access_id 20 ethernet source_mac 00-00-00-00-00-00 port 20 deny config access_profile profile_id 28 add access_id 21 ethernet source_mac 00-00-00-00-00-00 port 21 deny config access_profile profile_id 28 add access_id 22 ethernet source_mac 00-00-00-00-00-00 port 22 deny config access_profile profile_id 28 add access_id 23 ethernet source_mac 00-00-00-00-00-00 port 23 deny config access_profile profile_id 28 add access_id 24 ethernet source_mac 00-00-00-00-00-00 port 24 deny У меня еще есть 3200, для них чуточку отличается. Настройка для D-Link 3200 Закладка "Тип шлюза": D-Link 3200 Script Все остальное совпадает с предыдущим, кроме Подготовка самого свитча: Телнетимся и заливаем ему таблицу ACL: Код: create access_profile ip udp dst_port_mask 0xFFFF profile_id 4 create access_profile ip source_ip_mask 255.255.255.255 destination_ip_mask 255.255.255.248 profile_id 8 create access_profile ip source_ip_mask 255.255.255.248 destination_ip_mask 255.255.255.255 profile_id 12 create access_profile ip source_ip_mask 0.0.0.0 destination_ip_mask 255.255.255.255 profile_id 16 create access_profile ip source_ip_mask 255.255.255.255 destination_ip_mask 0.0.0.0 profile_id 20 create access_profile ethernet ethernet_type profile_id 24 config access_profile profile_id 24 add access_id auto_assign ethernet ethernet_type 0x806 port 1-24 permit create access_profile ethernet source_mac 00-00-00-00-00-00 profile_id 28 config access_profile profile_id 4 add access_id auto_assign ip udp dst_port 67 port 1-24 permit config access_profile profile_id 28 add access_id auto_assign ethernet source_mac 00-00-00-00-00-00 port 1-24 deny Все скрипты взяты из Wiki, возможно малость подредактированы. |
Автор: | barguzin2 [ 16 фев 2011, 20:23 ] |
Заголовок сообщения: | Re: D-Link + DHCP Opt.82 + Manad : Возможно ли ? |
Я за основу взял Модифицированный скрипт для D-Link`ов, он покомпактнее будет и достаточно внятный, малость подогнал правила под себя. 2 crez: работа DHCP нареканий не вызывает ? Столкнулся с ситуацией продления аренды адреса когда клиент сам посылает на сервер юникаст пакеты, на которые получает отлуп, т.к. выдача адресов идёт по Opt82, про которые клиент и ведать не ведает, поэтому лог DHCP весь заваливается сообщениями Код: DEBUG 16.02.2011 08:58:10,594 pool-1-thread-23 processing request DEBUG 16.02.2011 08:58:10,595 pool-1-thread-23 OP_BOOT_REQUEST DEBUG 16.02.2011 08:58:10,595 pool-1-thread-23 agent information is not found DEBUG 16.02.2011 08:58:10,595 pool-1-thread-23 trying to renew ip Можете привести конфиг основных параметров dhcp.properties |
Автор: | stark [ 16 фев 2011, 20:28 ] |
Заголовок сообщения: | Re: D-Link + DHCP Opt.82 + Manad : Возможно ли ? |
barguzin2 писал(а): Я за основу взял Модифицированный скрипт для D-Link`ов, он покомпактнее будет и достаточно внятный, малость подогнал правила под себя. 2 crez: работа DHCP нареканий не вызывает ? Столкнулся с ситуацией продления аренды адреса когда клиент сам посылает на сервер юникаст пакеты, на которые получает отлуп, т.к. выдача адресов идёт по Opt82, про которые клиент и ведать не ведает, поэтому лог DHCP весь заваливается сообщениями Код: DEBUG 16.02.2011 08:58:10,594 pool-1-thread-23 processing request DEBUG 16.02.2011 08:58:10,595 pool-1-thread-23 OP_BOOT_REQUEST DEBUG 16.02.2011 08:58:10,595 pool-1-thread-23 agent information is not found DEBUG 16.02.2011 08:58:10,595 pool-1-thread-23 trying to renew ip Можете привести конфиг основных параметров dhcp.properties я вам отвели на это в другой теме .. неправильно работать без relay |
Автор: | snark [ 21 фев 2011, 13:53 ] |
Заголовок сообщения: | Re: D-Link + DHCP Opt.82 + Manad : Возможно ли ? |
crez писал(а): Настройка для D-Link 3028 ... Подготовка самого свитча: Телнетимся и заливаем ему таблицу ACL (в таблице 248-я маска - та на которую пускаем при отрицательном балансе): Код: create access_profile ip destination_ip_mask 0.0.0.0 udp dst_port_mask 0xFFFF profile_id 4 config access_profile profile_id 4 add access_id 1 ip destination_ip 0.0.0.0 udp dst_port 67 port 1 permit config access_profile profile_id 4 add access_id 2 ip destination_ip 0.0.0.0 udp dst_port 67 port 2 permit config access_profile profile_id 4 add access_id 3 ip destination_ip 0.0.0.0 udp dst_port 67 port 3 permit config access_profile profile_id 4 add access_id 4 ip destination_ip 0.0.0.0 udp dst_port 67 port 4 permit config access_profile profile_id 4 add access_id 5 ip destination_ip 0.0.0.0 udp dst_port 67 port 5 permit config access_profile profile_id 4 add access_id 6 ip destination_ip 0.0.0.0 udp dst_port 67 port 6 permit config access_profile profile_id 4 add access_id 7 ip destination_ip 0.0.0.0 udp dst_port 67 port 7 permit config access_profile profile_id 4 add access_id 8 ip destination_ip 0.0.0.0 udp dst_port 67 port 8 permit config access_profile profile_id 4 add access_id 9 ip destination_ip 0.0.0.0 udp dst_port 67 port 9 permit config access_profile profile_id 4 add access_id 10 ip destination_ip 0.0.0.0 udp dst_port 67 port 10 permit config access_profile profile_id 4 add access_id 11 ip destination_ip 0.0.0.0 udp dst_port 67 port 11 permit config access_profile profile_id 4 add access_id 12 ip destination_ip 0.0.0.0 udp dst_port 67 port 12 permit config access_profile profile_id 4 add access_id 13 ip destination_ip 0.0.0.0 udp dst_port 67 port 13 permit config access_profile profile_id 4 add access_id 14 ip destination_ip 0.0.0.0 udp dst_port 67 port 14 permit config access_profile profile_id 4 add access_id 15 ip destination_ip 0.0.0.0 udp dst_port 67 port 15 permit config access_profile profile_id 4 add access_id 16 ip destination_ip 0.0.0.0 udp dst_port 67 port 16 permit config access_profile profile_id 4 add access_id 17 ip destination_ip 0.0.0.0 udp dst_port 67 port 17 permit config access_profile profile_id 4 add access_id 18 ip destination_ip 0.0.0.0 udp dst_port 67 port 18 permit config access_profile profile_id 4 add access_id 19 ip destination_ip 0.0.0.0 udp dst_port 67 port 19 permit config access_profile profile_id 4 add access_id 20 ip destination_ip 0.0.0.0 udp dst_port 67 port 20 permit config access_profile profile_id 4 add access_id 21 ip destination_ip 0.0.0.0 udp dst_port 67 port 21 permit config access_profile profile_id 4 add access_id 22 ip destination_ip 0.0.0.0 udp dst_port 67 port 22 permit config access_profile profile_id 4 add access_id 23 ip destination_ip 0.0.0.0 udp dst_port 67 port 23 permit config access_profile profile_id 4 add access_id 24 ip destination_ip 0.0.0.0 udp dst_port 67 port 24 permit create access_profile ip source_ip_mask 255.255.255.255 destination_ip_mask 255.255.255.248 profile_id 8 create access_profile ip source_ip_mask 255.255.255.248 destination_ip_mask 255.255.255.255 profile_id 12 create access_profile ip destination_ip_mask 255.255.255.255 profile_id 16 create access_profile ip source_ip_mask 255.255.255.255 profile_id 20 create access_profile ethernet ethernet_type profile_id 24 config access_profile profile_id 24 add access_id 1 ethernet ethernet_type 0x806 port 1 permit config access_profile profile_id 24 add access_id 2 ethernet ethernet_type 0x806 port 2 permit config access_profile profile_id 24 add access_id 3 ethernet ethernet_type 0x806 port 3 permit config access_profile profile_id 24 add access_id 4 ethernet ethernet_type 0x806 port 4 permit config access_profile profile_id 24 add access_id 5 ethernet ethernet_type 0x806 port 5 permit config access_profile profile_id 24 add access_id 6 ethernet ethernet_type 0x806 port 6 permit config access_profile profile_id 24 add access_id 7 ethernet ethernet_type 0x806 port 7 permit config access_profile profile_id 24 add access_id 8 ethernet ethernet_type 0x806 port 8 permit config access_profile profile_id 24 add access_id 9 ethernet ethernet_type 0x806 port 9 permit config access_profile profile_id 24 add access_id 10 ethernet ethernet_type 0x806 port 10 permit config access_profile profile_id 24 add access_id 11 ethernet ethernet_type 0x806 port 11 permit config access_profile profile_id 24 add access_id 12 ethernet ethernet_type 0x806 port 12 permit config access_profile profile_id 24 add access_id 13 ethernet ethernet_type 0x806 port 13 permit config access_profile profile_id 24 add access_id 14 ethernet ethernet_type 0x806 port 14 permit config access_profile profile_id 24 add access_id 15 ethernet ethernet_type 0x806 port 15 permit config access_profile profile_id 24 add access_id 16 ethernet ethernet_type 0x806 port 16 permit config access_profile profile_id 24 add access_id 17 ethernet ethernet_type 0x806 port 17 permit config access_profile profile_id 24 add access_id 18 ethernet ethernet_type 0x806 port 18 permit config access_profile profile_id 24 add access_id 19 ethernet ethernet_type 0x806 port 19 permit config access_profile profile_id 24 add access_id 20 ethernet ethernet_type 0x806 port 20 permit config access_profile profile_id 24 add access_id 21 ethernet ethernet_type 0x806 port 21 permit config access_profile profile_id 24 add access_id 22 ethernet ethernet_type 0x806 port 22 permit config access_profile profile_id 24 add access_id 23 ethernet ethernet_type 0x806 port 23 permit config access_profile profile_id 24 add access_id 24 ethernet ethernet_type 0x806 port 24 permit create access_profile ethernet source_mac 00-00-00-00-00-00 profile_id 28 config access_profile profile_id 28 add access_id 1 ethernet source_mac 00-00-00-00-00-00 port 1 deny config access_profile profile_id 28 add access_id 2 ethernet source_mac 00-00-00-00-00-00 port 2 deny config access_profile profile_id 28 add access_id 3 ethernet source_mac 00-00-00-00-00-00 port 3 deny config access_profile profile_id 28 add access_id 4 ethernet source_mac 00-00-00-00-00-00 port 4 deny config access_profile profile_id 28 add access_id 5 ethernet source_mac 00-00-00-00-00-00 port 5 deny config access_profile profile_id 28 add access_id 6 ethernet source_mac 00-00-00-00-00-00 port 6 deny config access_profile profile_id 28 add access_id 7 ethernet source_mac 00-00-00-00-00-00 port 7 deny config access_profile profile_id 28 add access_id 8 ethernet source_mac 00-00-00-00-00-00 port 8 deny config access_profile profile_id 28 add access_id 9 ethernet source_mac 00-00-00-00-00-00 port 9 deny config access_profile profile_id 28 add access_id 10 ethernet source_mac 00-00-00-00-00-00 port 10 deny config access_profile profile_id 28 add access_id 11 ethernet source_mac 00-00-00-00-00-00 port 11 deny config access_profile profile_id 28 add access_id 12 ethernet source_mac 00-00-00-00-00-00 port 12 deny config access_profile profile_id 28 add access_id 13 ethernet source_mac 00-00-00-00-00-00 port 13 deny config access_profile profile_id 28 add access_id 14 ethernet source_mac 00-00-00-00-00-00 port 14 deny config access_profile profile_id 28 add access_id 15 ethernet source_mac 00-00-00-00-00-00 port 15 deny config access_profile profile_id 28 add access_id 16 ethernet source_mac 00-00-00-00-00-00 port 16 deny config access_profile profile_id 28 add access_id 17 ethernet source_mac 00-00-00-00-00-00 port 17 deny config access_profile profile_id 28 add access_id 18 ethernet source_mac 00-00-00-00-00-00 port 18 deny config access_profile profile_id 28 add access_id 19 ethernet source_mac 00-00-00-00-00-00 port 19 deny config access_profile profile_id 28 add access_id 20 ethernet source_mac 00-00-00-00-00-00 port 20 deny config access_profile profile_id 28 add access_id 21 ethernet source_mac 00-00-00-00-00-00 port 21 deny config access_profile profile_id 28 add access_id 22 ethernet source_mac 00-00-00-00-00-00 port 22 deny config access_profile profile_id 28 add access_id 23 ethernet source_mac 00-00-00-00-00-00 port 23 deny config access_profile profile_id 28 add access_id 24 ethernet source_mac 00-00-00-00-00-00 port 24 deny profile_id 4 я бы укоротил до такого вида: Код: create access_profile ip udp dst_port_mask 0xffff profile_id 4 config access_profile profile_id 4 add access_id auto_assign ip udp dst_port 67 port 1-24 permit почему? дело в том что Код: destination_ip 0.0.0.0 тут в общем то не нужен, т.к. этот ACL вообще нужен только для того чтобы DHCP пакеты дошли до свича, т.к. в 3028 DHCP Relay работает _после_ ACL, а дальше свич их перехватит profile_id 24 я бы посоветовал сделать таким: Код: create access_profile packet_content_mask offset_0-15 0x0 0x0 0x0 0xffff0000 offset_16-31 0xffff0000 0x0 0x0 0xffffffff profile_id 24 зачем? тогда, чуть изменив скрипт, сможете заливать в свич ACL вида: Код: config access_profile profile_id 24 add access_id 1 packet_content offset 12 0x08060000 offset 16 0x08000000 offset 28 0xHEX.IP.addr port Х permit т.е. разрешать ARP запросы только с конкретного IP адреса (IP адрес должен быть в НЕХ) чем убережете себя от некоторых ARP атак |
Страница 1 из 1 | Часовой пояс: UTC + 5 часов [ Летнее время ] |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |