Далее настраиваем типы сервиса в модуле инет
Вложение:
Комментарий к файлу: Типы сервиса
service.jpg [ 115.92 КБ | Просмотров: 18817 ]
Создаем вот такое дерево устройств
Вложение:
Комментарий к файлу: Дерево
device.jpg [ 84.46 КБ | Просмотров: 18817 ]
Создаем конфигурацию устройства Access+Accounting
Код:
access.group=1
card.moduleId=2
#sa.radius.connection.attributes=NAS-IP-Address=46.8.32.204
radius.macAddress.vendor=14988
radius.macAddress.type=1
radius.inetOption.3.attributes=Service-Parameter:3=Rate=7168
radius.inetOption.4.attributes=Service-Parameter:4=Rate=10240
#accounting.worker.1.tariffication.1.batchSize=100
#accounting.worker.1.tariffication.1.delay=1
#accounting.worker.1.tariffication.1.minDeltaAmount=0
#accounting.worker.1.thread.count=1
#accounting.worker.1.tracking.1.batchSize=100
#accounting.worker.1.tracking.1.delay=2
#accounting.worker.2.flushing.1.batchSize=500
#accounting.worker.2.flushing.1.delay=2
#accounting.worker.2.flushing.1.minDeltaAccount=0
#accounting.worker.2.thread.count=1
#accounting.worker.3.finishing.1.batchSize=500
#accounting.worker.3.finishing.1.delay=2
#accounting.worker.3.thread.count=1
#connection.close.timeout=600
#connection.disable.close.timeout=1300
#connection.disable.suspend.timeout=900
#connection.finish.timeout=5
#connection.start.fromAccept=1
#connection.suspend.timeout=300
#contract.status.active.codes=0
#contract.status.suspend.codes=2,3,4,5,6
#deviceId=1
dhcp.key.pattern=$Login
#dhcp.option.serverIdentifier=0.0.0.0
#dhcp.relay.deviceTypeIds=
radius.servSearchMode=0
#dhcp.deviceSearchMode=0
radius.ipCategories=1
#dhcp.net.option.10.5.50.0:255.255.255.0.gate=10.5.50.1
#dhcp.net.option.10.5.50.0:255.255.255.0.subnetMask=255.255.255.0
#dhcp.net.option.10.5.50.0:255.255.2550.0.dns=10.5.50.1
dhcp.option.leaseTime=900
#flow.agent.link=2:-1
#flow.agent.type=netflow
ip.resource.categoryId=1
#manage.error.pause=5
#manage.uptime.error.pause=360
#manage.uptime.pause=360
radius.realm=default
radius.key.deviceTypeIds=1
radius.password.verification=0
#radius.port=1700
sa.radius.log=1
sa.radius.host=46.8.32.204
sa.radius.secret=transportit
Конфигурация устройства Mikrotik
Код:
ip.resource.categoryId=1
Конфигурация типа устройства Access+Accounting
Код:
dhcp.key.pattern=$mac
dhcp.renew=1
Конфигурация типа устройства Mikrotik
Вложение:
Комментарий к файлу: Тип устройства Mikrotik
type_mikrotik.jpg [ 190.59 КБ | Просмотров: 18817 ]
подробнее о командах
Код:
sa.command.serv.create.1=/ip/firewall/filter/print\n?=comment=!!DENY!!
sa.command.serv.create.2=/ip/firewall/filter/add\n=chain=forward\n=place-before=$prevIdList\n=src-mac-address=$mac\n=disabled=yes\n=src-address=$ip\n=comment=!!$servId!!
sa.command.inetOption.3.enable=/queue/simple/add\n=max-limit=7M/7M\n=dst-address=$ip\n=comment=!!$servId!!
sa.command.inetOption.4.enable=/queue/simple/add\n=max-limit=10M/10M\n=dst-address=$ip\n=comment=!!$servId!!
sa.command.serv.enable=/ip/firewall/filter/enable\n=numbers="!!$servId!!"
sa.command.serv.disable=/ip/firewall/filter/disable\n=numbers=!!$servId!!
sa.command.serv.cancel=/ip/firewall/filter/remove\n=numbers="!!$servId!!";/queue/simple/remove\n=numbers="!!$servId!!"
flow.agent.type=netflow
flow.agent.link=2:-1
Первая команда создает правило фаирвола, добавляет в него mac и ip абонента, но не активирует его.
Команда опций в зависимости от дабавленной на договор, создает правило в Queues с ограничением соответствующей тарифу скорости.
Здесь появляется первая проблема невозможно использовать опцию Target-address, приходится использовать dst-address, что не правильно но не смертельноДалее идут команды включения и выключения правила фаирвола.
Ну и последняя команда удаляет правило при необходимости.