Вы просматриваете старую версию данной страницы. Смотрите текущую версию.
Сравнить с текущим |
просмотр истории страницы
Хук: /app/reductor/cfg/userinfo/hooks/billing_redirect.sh
#!/bin/bash ipset_prepare() { if [ "${billing['negbal']}" = '1' ]; then if [ -n "${billing['subnet']}" ]; then ipset create auth bitmap:ip,mac range "${billing['subnet']}" 2>/dev/null || true else ipset create auth iphash 2>/dev/null || true fi ipset flush auth for ipset in negbal blocked; do ipset create $ipset hash:net 2>/dev/null || true ipset flush $ipset done while read net; do ipset add negbal $net || true done < /cfg/userinfo/hooks/negbal.list || true fi }
chmod a+x /app/reductor/cfg/userinfo/hooks/billing_redirect.sh
Список сетей для блокировки: /app/reductor/cfg/userinfo/hooks/negbal.list
10.30.30.0/24
Маски шире /16 не поддерживаются, разбейте сеть на более мелкие.
Опции для работы в конфиге /app/reductor/cfg/config :
declare -A billing
billing['negbal']='1'
billing['ip']=''
billing['negbal_ip']='10.50.140.73'
billing['negbal_dns_ip']='10.50.140.73'
billing['negbal_url']='http://10.50.140.73/'
billing['blocked_ip']=''
billing['blocked_dns_ip']=''
billing['blocked_url']=''
billing['noauth_ip']=''
billing['noauth_dns_ip']=''
billing['noauth_url']=''
billing['subnet']='10.30.30.0/24'
billing['nocheckauth']='1'
billing['justsync']='0'
billing['other_traffic']='1'
10.50.140.73 - IP адрес заглушки настроенной по статье: https://github.com/carbonsoft/reductor_blockpages