Как включить старую модель шейпера?

Платформа Mikrotik
Ответить
kalina
Сообщения: 2
Зарегистрирован: Пт сен 25, 2015 7:33 am

Как включить старую модель шейпера?

Сообщение kalina » Пт сен 25, 2015 7:54 am

Добрый день!
подскажите пожалуйста как вернуть старую модель шейперов в версии ABillS 0.57+mikrotik V6.9?
установил параметр в конфиге /usr/abills/libexec/config.pl --> $conf{MIKROTIK_QUEUES}=1;
вычитал на http://abills.net.ua/wiki/doku.php/abil ... tik:shaper

Дело в том что новая модель не совсем корректно работает или я не разобрался с ней. В ответах радиуса идет параметр Mikrotik-Address-List = "CLIENTS_1" хотя при выполнении /usr/abills/libexec/billd checkspeed mikrotik RECONFIGURE=1 этот адреслист не создается
но при этом указывается в настройках Mangle
как заставить радиус передавать микротику параметры Ascend-Xmit-Rate и Ascend-Data-Rate

вот вывод freeradius -X (тут запуск Radius и одна Авторизация)

Код: Выделить всё

root@abills:~# freeradius -X
FreeRADIUS Version 2.1.12, for host x86_64-pc-linux-gnu, built on Aug 26 2015 at 14:47:03
Copyright (C) 1999-2009 The FreeRADIUS server project and contributors.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
You may redistribute copies of FreeRADIUS under the terms of the
GNU General Public License v2.
Starting - reading configuration files ...
including configuration file /etc/freeradius/radiusd.conf
including configuration file /etc/freeradius/clients.conf
including files in directory /etc/freeradius/modules/
including configuration file /etc/freeradius/modules/pap
including configuration file /etc/freeradius/modules/chap
including configuration file /etc/freeradius/modules/mac2vlan
including configuration file /etc/freeradius/modules/otp
including configuration file /etc/freeradius/modules/files
including configuration file /etc/freeradius/modules/radutmp
including configuration file /etc/freeradius/modules/smbpasswd
including configuration file /etc/freeradius/modules/attr_rewrite
including configuration file /etc/freeradius/modules/exec
including configuration file /etc/freeradius/modules/detail.log
including configuration file /etc/freeradius/modules/detail.example.com
including configuration file /etc/freeradius/modules/opendirectory
including configuration file /etc/freeradius/modules/attr_filter
including configuration file /etc/freeradius/modules/sradutmp
including configuration file /etc/freeradius/modules/rediswho
including configuration file /etc/freeradius/modules/counter
including configuration file /etc/freeradius/modules/linelog
including configuration file /etc/freeradius/modules/realm
including configuration file /etc/freeradius/modules/unix
including configuration file /etc/freeradius/modules/soh
including configuration file /etc/freeradius/modules/passwd
including configuration file /etc/freeradius/modules/detail
including configuration file /etc/freeradius/modules/ldap
including configuration file /etc/freeradius/modules/expr
including configuration file /etc/freeradius/modules/inner-eap
including configuration file /etc/freeradius/modules/preprocess
including configuration file /etc/freeradius/modules/smsotp
including configuration file /etc/freeradius/modules/logintime
including configuration file /etc/freeradius/modules/mac2ip
including configuration file /etc/freeradius/modules/checkval
including configuration file /etc/freeradius/modules/acct_unique
including configuration file /etc/freeradius/modules/expiration
including configuration file /etc/freeradius/modules/always
including configuration file /etc/freeradius/modules/wimax
including configuration file /etc/freeradius/modules/dynamic_clients
including configuration file /etc/freeradius/modules/perl
including configuration file /etc/freeradius/modules/cui
including configuration file /etc/freeradius/modules/replicate
including configuration file /etc/freeradius/modules/pam
including configuration file /etc/freeradius/modules/digest
including configuration file /etc/freeradius/modules/echo
including configuration file /etc/freeradius/modules/ippool
including configuration file /etc/freeradius/modules/sqlcounter_expire_on_login
including configuration file /etc/freeradius/modules/sql_log
including configuration file /etc/freeradius/modules/etc_group
including configuration file /etc/freeradius/modules/krb5
including configuration file /etc/freeradius/modules/mschap
including configuration file /etc/freeradius/modules/redis
including configuration file /etc/freeradius/modules/policy
including configuration file /etc/freeradius/modules/ntlm_auth
including configuration file /etc/freeradius/policy.conf
including files in directory /etc/freeradius/sites-enabled/
including configuration file /etc/freeradius/sites-enabled/abills_default
main {
        user = "freerad"
        group = "freerad"
        allow_core_dumps = no
}
including dictionary file /etc/freeradius/dictionary
main {
        name = "radiusd"
        prefix = "/etc/freeradius"
        localstatedir = "/var"
        sbindir = "/etc/freeradius/sbin"
        logdir = "/var/log"
        run_dir = "/var/run/radiusd"
        libdir = "/usr/local/lib/freeradius-2.1.6"
        radacctdir = "/var/log/radacct"
        hostname_lookups = no
        max_request_time = 30
        cleanup_delay = 5
        max_requests = 512000
        pidfile = "/var/run/radiusd/radiusd.pid"
        checkrad = "/etc/freeradius/sbin/checkrad"
        debug_level = 0
        proxy_requests = no
 log {
        stripped_names = no
        auth = no
        auth_badpass = no
        auth_goodpass = no
 }
 security {
        max_attributes = 200
        reject_delay = 1
        status_server = yes
 }
}
radiusd: #### Loading Realms and Home Servers ####
radiusd: #### Loading Clients ####
 client 195.177.124.118 {
        require_message_authenticator = no
        secret = "$/|on0poTam"
        shortname = "office"
 }
radiusd: #### Instantiating modules ####
 instantiate {
 Module: Linked to module rlm_exec
 Module: Instantiating module "exec" from file /etc/freeradius/modules/exec
  exec {
        wait = no
        input_pairs = "request"
        shell_escape = yes
  }
 Module: Linked to module rlm_expiration
 Module: Instantiating module "expiration" from file /etc/freeradius/modules/expiration
  expiration {
        reply-message = "Password Has Expired  "
  }
 Module: Linked to module rlm_logintime
 Module: Instantiating module "logintime" from file /etc/freeradius/modules/logintime
  logintime {
        reply-message = "You are calling outside your allowed timespan  "
        minimum-timeout = 60
  }
 }
radiusd: #### Loading Virtual Servers ####
server { # from file /etc/freeradius/radiusd.conf
 modules {
  Module: Creating Auth-Type = Perl
  Module: Creating Post-Auth-Type = REJECT
 Module: Checking authenticate {...} for more modules to load
 Module: Linked to module rlm_pap
 Module: Instantiating module "pap" from file /etc/freeradius/modules/pap
  pap {
        encryption_scheme = "auto"
        auto_header = no
  }
 Module: Linked to module rlm_mschap
 Module: Instantiating module "mschap" from file /etc/freeradius/modules/mschap
  mschap {
        use_mppe = yes
        require_encryption = no
        require_strong = no
        with_ntdomain_hack = no
        allow_retry = yes
  }
 Module: Linked to module rlm_perl
 Module: Instantiating module "perl" from file /etc/freeradius/modules/perl
  perl {
        module = "/usr/abills/libexec/rlm_perl.pl"
        func_authorize = "authorize"
        func_authenticate = "authenticate"
        func_accounting = "accounting"
        func_preacct = "preacct"
        func_checksimul = "checksimul"
        func_detach = "detach"
        func_xlat = "xlat"
        func_pre_proxy = "pre_proxy"
        func_post_proxy = "post_proxy"
        func_post_auth = "post_auth"
        func_recv_coa = "recv_coa"
        func_send_coa = "send_coa"
  }
 Module: Checking authorize {...} for more modules to load
 Module: Linked to module rlm_preprocess
 Module: Instantiating module "preprocess" from file /etc/freeradius/modules/preprocess
  preprocess {
        huntgroups = "/etc/freeradius/huntgroups"
        hints = "/etc/freeradius/hints"
        with_ascend_hack = no
        ascend_channels_per_line = 23
        with_ntdomain_hack = no
        with_specialix_jetstream_hack = no
        with_cisco_vsa_hack = no
        with_alvarion_vsa_hack = no
  }
 Module: Linked to module rlm_files
 Module: Instantiating module "files" from file /etc/freeradius/modules/files
  files {
        usersfile = "/etc/freeradius/users"
        acctusersfile = "/etc/freeradius/acct_users"
        preproxy_usersfile = "/etc/freeradius/preproxy_users"
        compat = "no"
  }
 Module: Checking preacct {...} for more modules to load
 Module: Checking accounting {...} for more modules to load
 Module: Checking post-auth {...} for more modules to load
 } # modules
} # server
radiusd: #### Opening IP addresses and Ports ####
listen {
        type = "auth"
        ipaddr = *
        port = 0
}
listen {
        type = "acct"
        ipaddr = *
        port = 0
}
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Ready to process requests.
rad_recv: Access-Request packet from host 195.177.124.118 port 34984, id=183, length=147
        Service-Type = Framed-User
        Framed-Protocol = PPP
        NAS-Port = 2147483762
        NAS-Port-Type = Ethernet
        User-Name = "test"
        Calling-Station-Id = "00:16:76:7E:A3:10"
        Called-Station-Id = "test"
        NAS-Port-Id = "ether10-slave-local"
        CHAP-Challenge = 0x5406276e4366eb298d816c8723627f3e
        CHAP-Password = 0x0172dbc100436a73f76195192f823c5d00
        NAS-Identifier = "Office"
        NAS-IP-Address = 195.177.124.118
# Executing section authorize from file /etc/freeradius/sites-enabled/abills_default
+- entering group authorize {...}
++[preprocess] returns ok
++[mschap] returns noop
[files] users: Matched entry DEFAULT at line 38
++[files] returns ok
Auth-Type := Accept
rlm_perl: Added pair NAS-Port = 2147483762
rlm_perl: Added pair CHAP-Password = 0x0172dbc100436a73f76195192f823c5d00
rlm_perl: Added pair NAS-Port-Id = ether10-slave-local
rlm_perl: Added pair Service-Type = Framed-User
rlm_perl: Added pair NAS-IP-Address = 195.177.124.118
rlm_perl: Added pair CHAP-Challenge = 0x5406276e4366eb298d816c8723627f3e
rlm_perl: Added pair Called-Station-Id = test
rlm_perl: Added pair NAS-Identifier = Office
rlm_perl: Added pair NAS-Port-Type = Ethernet
rlm_perl: Added pair Framed-Protocol = PPP
rlm_perl: Added pair User-Name = test
rlm_perl: Added pair Calling-Station-Id = 00:16:76:7E:A3:10
rlm_perl: Added pair Framed-IP-Address = 195.177.127.155
rlm_perl: Added pair Framed-IP-Netmask = 255.255.255.255
rlm_perl: Added pair Session-Octets-Limit =
rlm_perl: Added pair Mikrotik-Address-List = CLIENTS_1
rlm_perl: Added pair Acct-Interim-Interval = 120
rlm_perl: Added pair Auth-Type = Accept
++[perl] returns ok
Found Auth-Type = Accept
Auth-Type = Accept, accepting the user
  WARNING: Empty post-auth section.  Using default return values.
# Executing section post-auth from file /etc/freeradius/sites-enabled/abills_default
Sending Access-Accept of id 183 to 195.177.124.118 port 34984
        Framed-IP-Address = 195.177.127.155
        Framed-IP-Netmask = 255.255.255.255
        Session-Octets-Limit = 0
        Mikrotik-Address-List = "CLIENTS_1"
        Acct-Interim-Interval = 120
Finished request 0.
Going to the next request
Waking up in 4.9 seconds.
rad_recv: Accounting-Request packet from host 195.177.124.118 port 53479, id=184, length=150
        Service-Type = Framed-User
        Framed-Protocol = PPP
        NAS-Port = 2147483762
        NAS-Port-Type = Ethernet
        User-Name = "test"
        Calling-Station-Id = "00:16:76:7E:A3:10"
        Called-Station-Id = "test"
        NAS-Port-Id = "ether10-slave-local"
        Acct-Session-Id = "81000072"
        Framed-IP-Address = 195.177.127.155
        Acct-Authentic = RADIUS
        Event-Timestamp = "Sep 25 2015 10:38:15 EEST"
        Acct-Status-Type = Start
        NAS-Identifier = "Office"
        Acct-Delay-Time = 0
        NAS-IP-Address = 195.177.124.118
# Executing section preacct from file /etc/freeradius/sites-enabled/abills_default
+- entering group preacct {...}
++[preprocess] returns ok
# Executing section accounting from file /etc/freeradius/sites-enabled/abills_default
+- entering group accounting {...}
rlm_perl: Added pair NAS-Port-Id = ether10-slave-local
rlm_perl: Added pair NAS-IP-Address = 195.177.124.118
rlm_perl: Added pair Framed-IP-Address = 195.177.127.155
rlm_perl: Added pair Called-Station-Id = test
rlm_perl: Added pair NAS-Identifier = Office
rlm_perl: Added pair Acct-Session-Id = 81000072
rlm_perl: Added pair Framed-Protocol = PPP
rlm_perl: Added pair Calling-Station-Id = 00:16:76:7E:A3:10
rlm_perl: Added pair NAS-Port = 2147483762
rlm_perl: Added pair Service-Type = Framed-User
rlm_perl: Added pair Acct-Status-Type = Start
rlm_perl: Added pair Acct-Delay-Time = 0
rlm_perl: Added pair Event-Timestamp = Sep 25 2015 10:38:15 EEST
rlm_perl: Added pair NAS-Port-Type = Ethernet
rlm_perl: Added pair Acct-Authentic = RADIUS
rlm_perl: Added pair User-Name = test
++[perl] returns ok
Sending Accounting-Response of id 184 to 195.177.124.118 port 53479
Finished request 1.
Cleaning up request 1 ID 184 with timestamp +16
Going to the next request
Waking up in 4.9 seconds.
и конфиг /usr/abills/libexec/config.pl

Код: Выделить всё

#!/usr/bin/perl -w
# Abills configuretion file

$PROGRAM='~AsmodeuS~ Billing System';

#DB configuration
$conf{dbhost}='localhost';
$conf{dbname}='#';
$conf{dbuser}='#';
$conf{dbpasswd}='#';
$conf{dbtype}='mysql';
#For MySQL 5 and highter (cp1251, utf8)
$conf{dbcharset}='utf8';

#Mail configuration
$conf{ADMIN_MAIL}='admin@yourhost.com';
$conf{USERS_MAIL_DOMAIN}='yourhost.com';
$conf{MAIL_CHARSET}='utf-8';
$conf{default_language}='russian';
$conf{default_charset}='utf-8';
$conf{WEB_TITLE}='';
$conf{MIKROTIK_QUEUES}=1;



@MODULES = ('Dv',
            'Voip',
            'Docs',
            'Mail',
            'Msgs',
            'Sqlcmd');


%ACCT = ();
#For VoIP GNU Gatekeeper accounting
$ACCT{gnugk} = 'Voip_aaa';

%AUTH = ();
#For VoIP GNU Gatekeeper Auth
$AUTH{gnugk} = 'Voip_aaa';

#Technical works banner in admin and user interface
#$conf{tech_works}='Technical works';

#Periodic functions
$conf{p_admin_mails}=1;  # Send periodic admin reports
$conf{p_users_mails}=1;  # Send user warning  messages

# chap encryption decription key
$conf{secretkey}="test12345678901234567890";
#$conf{s_detalization}=1; #make session detalization recomended for vpn leathed lines
$conf{ERROR2DB}=1;

$conf{version}='0.57/20141120'; #08.12.2012

#Octets direction
# server - Count octets from server side
# user   - Count octets from user side (default)
$conf{octets_direction}='user';

#Check web interface brute force
$conf{wi_bruteforce}=10;
$conf{user_finance_menu}=1;
$conf{user_finance_menu}=1;

#Minimum session costs
$conf{MINIMUM_SESSION_TIME}=10; # minimum session time for push session to db
$conf{MINIMUM_SESSION_TRAF}=200; # minimum session trafic for push session to db

#System admin id
#ID for system operation, periodic procces
$conf{SYSTEM_ADMIN_ID}=2;
#ID For users web operations
$conf{USERS_WEB_ADMIN_ID}=3;

#System Langs
$conf{LANGS}="english:English;
 russian:Русский;
 ukraine:Українська;
 bulgarian:Болгарська;
 french:French";

#Web interface
$conf{PASSWD_LENGTH}=6;
$conf{MAX_USERNAME_LENGTH}=15;
# User name expration
$conf{USERNAMEREGEXP}="^[a-z0-9_][a-z0-9_-]*\$";
$conf{list_max_recs}=25;
$conf{web_session_timeout} = 86000;
$conf{user_chg_passwd}=0;
#Max session traffic Mb
#$conf{MAX_SESSION_TRAFFIC} = 2047;


# Exppp options
#$conf{DV_EXPPP_NETFILES}='/usr/abills/cgi-bin/admin/nets/';
#Auto assigning MAC in first connect
$conf{MAC_AUTO_ASSIGN}=1;
$conf{KBYTE_SIZE} = 1024;

# Debug mod
$conf{debug}=10;
$conf{foreground}=0;
$conf{debugmods}='LOG_ALERT LOG_WARNING LOG_ERR LOG_INFO';

#show auth and accounting time need Time::HiRes module (available from CPAN)
# Check script runnig time
$conf{time_check}=1;
$conf{RADIUS2}=1;

#Firewall start rule numbers
# (GLobal, Class 1, Class 2)
@START_FW = (5000, 3000, 1000);


# Backup SQL data
$conf{BACKUP_DIR}='/usr/abills/backup';


# Folders and files
$base_dir='/usr/abills/';
$lang_path=$base_dir . 'language/';
$lib_path=$base_dir .'libexec/';
$var_dir=$base_dir .'var/';
$conf{SPOOL_DIR}=$base_dir.'var/q';
$conf{SPOOL_DIR}=$base_dir.'var/q';

# Template folder
$conf{TPL_DIR}   = $base_dir . 'Abills/templates/';
$conf{LOG_DEBUG} = $base_dir . 'var/log/abills.debug';
$conf{LOGFILE}   = $base_dir . 'var/log/abills.log';

#For file auth type allow file
$conf{extern_acct_dir}=$base_dir.'libexec/ext_acct/';

use POSIX qw(strftime);
$DATE = strftime "%Y-%m-%d", localtime(time);

$TIME = strftime "%H:%M:%S", localtime(time);
$curtime = strftime("%F %H.%M.%S", localtime(time));
$year = strftime("%Y", localtime(time));


1


kalina
Сообщения: 2
Зарегистрирован: Пт сен 25, 2015 7:33 am

Re: Как включить старую модель шейпера?

Сообщение kalina » Пт сен 25, 2015 12:29 pm

как видите в конфиге я включил этот параметр, но в радиус пакете нету Ascend-Xmit-Rate и Ascend-Data-Rate параметров для микротика а есть Mikrotik-Address-List = "CLIENTS_1" видно по дебагу freeradius -X

~AsmodeuS~
Site Admin
Сообщения: 5592
Зарегистрирован: Пт янв 28, 2005 3:11 pm
Контактная информация:

Re: Как включить старую модель шейпера?

Сообщение ~AsmodeuS~ » Сб сен 26, 2015 10:55 am

kalina писал(а):как видите в конфиге я включил этот параметр, но в радиус пакете нету Ascend-Xmit-Rate и Ascend-Data-Rate параметров для микротика а есть Mikrotik-Address-List = "CLIENTS_1" видно по дебагу freeradius -X
это только в 0.7 версии

kalinux
Сообщения: 8
Зарегистрирован: Чт июн 12, 2014 9:50 am

Re: Как включить старую модель шейпера?

Сообщение kalinux » Пн сен 26, 2016 3:09 pm

Старую модель шейпера все таки включили, теперь бы хотелось поменять Queue Type

по дефолту создается default-small. Можно так чтобы шейпер по умолчанию создавался queue type - Ethernet default а не default-small?

~AsmodeuS~
Site Admin
Сообщения: 5592
Зарегистрирован: Пт янв 28, 2005 3:11 pm
Контактная информация:

Re: Как включить старую модель шейпера?

Сообщение ~AsmodeuS~ » Вт сен 27, 2016 8:45 am

kalinux писал(а):Старую модель шейпера все таки включили, теперь бы хотелось поменять Queue Type

по дефолту создается default-small. Можно так чтобы шейпер по умолчанию создавался queue type - Ethernet default а не default-small?

нет такое поведениепрописано в самом микротие для активизации полиси радиус парами,

если нужно другое поведение, создате свои правила шепера и передавайте IP в адрес листы

Ответить