SoNiC pisze:
Intruxem sie nie przejmuj oni nie zrobia czegos takiego jak lms narazie, linuxrouter byc moze a mms to kopia wprost easynet sprzedaje podobny panel oparty o lmsa.
Zwierzu na jakich zasadach dziala wspolpraca LMS z mikrotikiem?
Na przykład tak:
sql sql_mac_auth_mt_set_ssid { driver = "rlm_sql_mysql"
server = "localhost" login = "lms" password = "lms_pass"
radius_db = "1104"
deletestalesessions = yes
sqltrace = yes sqltracefile = ${logdir}/sqltrace.sql
num_sql_socks = 10
connect_failure_retry_delay = 60
sql_user_name = "%{User-Name}" sql_set_password = ""
authorize_check_query = "SELECT n.id id, upper(n.mac) as 'UserName', 'User-Password' as Attribute, '' as value, '==' as op from mt_netdevices devs join mt_netdevices_ports devpts on devs.id = devpts.device_id join nodes n on devpts.id = n.port_id and upper(n.mac) = '%{SQL-User-Name}' and nas_port_id='%{NAS-Port-Id}' and devs.name='NAS-Identifier' and access=1 ORDER BY id"
}
Tutaj akurat dodałem własną tabelę mt_netdevices i mt_netdevices_ports , żeby móc ograniczyć klienta do konkretnego portu.
Dla PPPoE:
sql sql_pppoe_auth_mt_w_sn { driver = "rlm_sql_mysql"
server = "localhost" login = "lms" password = "lms_pass"
radius_db = "1104"
deletestalesessions = yes
sqltrace = yes sqltracefile = ${logdir}/sqltrace.sql
num_sql_socks = 10
connect_failure_retry_delay = 60
sql_user_name = "%{User-Name}" sql_set_password = ""
authorize_check_query = "SELECT n.id id, username UserName, 'User-Password' Attribute, passwd Value, '==' op FROM nodes n JOIN pppoeservers p ON p.id=n.pppoe_service_id AND p.servicename='%{Called-Station-Id}' AND upper(n.mac)='%{Calling-Station-Id}' AND username='%{SQL-User-Name}' AND access=1 ORDER BY id" authorize_reply_query = "SELECT nodes.id id, username UserName, 'Framed-IP-Address' Attribute, inet_ntoa(ipaddr) Value, '==' op FROM assignments LEFT JOIN tariffs ON (tariffid = tariffs.id) LEFT JOIN nodes ON (customerid = ownerid) JOIN networks on (ipaddr & inet_aton(mask)) = address WHERE access = 1 AND (datefrom <= UNIX_TIMESTAMP() OR datefrom = 0) AND (dateto >= UNIX_TIMESTAMP() OR dateto = 0) AND username = '%{User-Name}' \ UNION \ SELECT nodes.id id, username UserName, 'Mikrotik-Rate-Limit' Attribute, concat(upceil * 1024,'/',downceil * 1024) Value, '==' op FROM assignments LEFT JOIN tariffs ON (tariffid = tariffs.id) LEFT JOIN nodes ON (customerid = ownerid) JOIN networks on (ipaddr & inet_aton(mask)) = address WHERE access = 1 AND (datefrom <= UNIX_TIMESTAMP() OR datefrom = 0) AND (dateto >= UNIX_TIMESTAMP() OR dateto = 0) AND username = '%{User-Name}'" }
Zapytania może nie są najpiękniejsze , ale niestety specem od sql nie jestem. Nie wiem czy też sa bez błędów, bo wkleiłem z jakiegoś sql.conf, który mi się walał po $HOME
Pozdrawiam.
!DSPAM:49a47ee756481703090906!