{"id":272179,"date":"2016-01-15T11:31:02","date_gmt":"2016-01-15T08:31:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=272179"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=272179","title":{"rendered":"HotSpot \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Cisco WLC5508, FreeRadius, MySQL \u0438 Easyhotspot"},"content":{"rendered":"<p>       \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A5%D0%BE%D1%82-%D1%81%D0%BF%D0%BE%D1%82_%28Wi-Fi%29\">HotSpot<\/a>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u0437\u043d\u0443\u0442\u0440\u0438 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0443\u043f\u043e\u0440 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 freeRadius, MySQL \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u0430 Easyhotspot.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430\u0448\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043d\u0430 Cisco WLC5508 \u0438 CentOS. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0435 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0445\u0435\u043c\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/02c\/b47\/3fb\/02cb473fb16b4f849de80e647a7588f1.jpg\"\/><br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 <a href=\"http:\/\/sourceforge.net\/projects\/easyhotspot\/\">Easyhotspot<\/a>, \u043f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u0431\u0438\u043b\u043b\u0438\u043d\u0433, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u042d\u0442\u043e open-source \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0435\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u043f\u0440\u043e\u0441\u0442 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u043c\u044b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c username \u0438 password, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 MySQL \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044e\u0437\u0435\u0440\u0443. \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u0442\u043e\u0447\u043a\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c Cisco WLC. \u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043a\u0430\u043a\u0443\u044e \u043b\u0438\u0431\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u044e\u0437\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u043a\u0438\u043d\u0435\u0442 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u043e\u043d \u0432\u0432\u0435\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043a\u0440\u0435\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044b.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0438\u0445 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442 \u0438 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 access-request \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 FreeRadius&#8217;\u0443. \u0422\u043e\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u0439\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0438 \u043e\u0442\u0432\u0435\u0442\u0438\u0442 \u0432\u0430\u0439-\u0444\u0430\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443, \u0447\u0442\u043e \u0432\u0441\u0435 \u043e\u043a, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b\u0434\u0430\u0441\u0442 \u0432\u0440\u0435\u043c\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u0435\u043d. \u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/RADIUS\">RADIUS<\/a>, \u0432\u0430\u0439-\u0444\u0430\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 Cisco WLC \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0434\u0438\u0443\u0441-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Network_access_server\">NAS<\/a>-\u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c (Network Access Server), \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0438 hotspot \u044d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Captive_portal\">captive portal<\/a>. \u0417\u0430\u0434\u0430\u0447\u0435\u0439 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043e\u043a\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u0440\u0435\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044b \u0440\u0430\u0434\u0438\u0443\u0441-\u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u0438 \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u043e \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>  \u0418 \u0445\u043e\u0442\u044c Easyhotspot \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 captive portal, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f Chillispot, \u043d\u0430\u043c \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e \u043d\u0435\u0432\u0430\u0436\u043d\u043e. <br \/>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u044b\u043b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d, NAS \u0434\u043e\u043b\u0436\u0435\u043d \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0430\u0434\u0438\u0443\u0441-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043e\u0442\u0447\u0435\u0442\u044b \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u044e\u0437\u0435\u0440\u043e\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445: \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0438 \u0442\u043f. \u0412\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u043e freeRadius \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0410 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f, \u0434\u043b\u044f \u044e\u0437\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0441\u0442\u0438\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u0447\u0435\u0433\u043e \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0435\u043c\u0443 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e.<\/p>\n<p>  \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Radius. \u042d\u0442\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0434\u0435\u043b\u0438\u0441\u0442\u044f \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438, \u044d\u0442\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\/\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433. \u041f\u0435\u0440\u0432\u0443\u044e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 <a href=\"https:\/\/tools.ietf.org\/html\/rfc2865\">RFC 2865<\/a>, \u0432\u0442\u043e\u0440\u0443\u044e <a href=\"https:\/\/tools.ietf.org\/html\/rfc2866\">RFC 2866<\/a>. \u041e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u044c\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0438 \u0442\u043e, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043b\u044f \u043d\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u0430\u0445 1812 \u0438 1813.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043e\u0442\u0432\u0435\u0442\u044b, \u0438 \u0442\u043e, \u043a\u0430\u043a \u043e\u043d\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f FreeRadius&#8217;\u043e\u043c, \u0430 \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 CentOS 6.5 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u0442\u044c\u044e \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0437 \u0441\u0435\u0442\u0438:<\/p>\n<pre><code class=\"bash\">yum install wget <\/code><\/pre>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439:<\/p>\n<pre><code class=\"bash\">wget http:\/\/download.fedoraproject.org\/pub\/epel\/6\/x86_64\/epel-release-6-8.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm <\/code><\/pre>\n<p>  \u041e\u0431\u043d\u043e\u0432\u0438\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<pre><code class=\"bash\">yum repolist yum update <\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b, MySQL, Apache \u0438 php:<\/p>\n<pre><code class=\"bash\">yum install mc vim unzip gcc gcc-c++ make git svn nano yum install mysql-server php httpd php-mysql php-xml php-gd php-pear php-db yum install patch mod_ssl openssl dnsmasq <\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 \/etc\/php.ini \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<pre><code class=\"bash\">short_open_tag = On <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0437\u0430\u0431\u044b\u0442\u044c \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435, \u0442\u043e \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443 \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"html\">EasyHotSpot config-&gt;item('EASYHOTSPOT_VERSION');?&gt; load-&gt;view($this-&gt;config-&gt;item('FAL_template_dir').'template\/menu');?&gt;  EasyHotspot - Hotspot Management System  GNU Public License <\/code><\/pre>\n<p>  \u0422\u0430\u043c \u0436\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/php.ini:<\/p>\n<pre><code class=\"bash\">date.timezone = Europe\/Moscow <\/code><\/pre>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431 MySQL \u0438 Apache \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438:<\/p>\n<pre><code class=\"bash\">chkconfig --level 235 httpd on chkconfig --level 235 mysqld on chkconfig --level 235 dnsmasq on <\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c Easyhotspot. \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u043c easyhotspot \u043e\u0442\u0441\u044e\u0434\u0430 <a href=\"https:\/\/github.com\/rafeequl\">github.com\/rafeequl<\/a>:<\/p>\n<pre><code class=\"bash\">cd \/opt git clone https:\/\/github.com\/rafeequl\/EasyHotspot ln -s \/opt\/EasyHotspot\/htdocs \/var\/www\/html\/easyhotspot <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 easyhotspot_opensource:<\/p>\n<pre><code class=\"bash\">mysql mysql&gt; create database easyhotspot_opensource; mysql&gt; CREATE USER 'easyhotspot'@'localhost'; mysql&gt; SET PASSWORD FOR 'easyhotspot'@'localhost' = PASSWORD('easyhotspot'); mysql&gt; GRANT ALL ON easyhotspot_opensource.* to 'easyhotspot'@'localhost'; mysql&gt; quit mysql -u root easyhotspot_opensource &lt; \/opt\/EasyHotspot\/install\/database_with_sample.sql <\/code><\/pre>\n<p>  \u0412 EasyHotspot \u0432 \u043c\u0435\u043d\u044e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0430 Chillispot. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0436\u0438\u043c\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0435, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443. \u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e, \u0443\u0434\u0430\u043b\u0438\u043c \u0435\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0438\u043b\u0438 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \/opt\/EasyHotspot\/htdocs\/system\/application\/views\/admin\/header.php:<\/p>\n<pre><code class=\"php\">&lt;!--   &lt;li class=&quot;chillispot&quot;&gt;&lt;?=anchor('admin\/chillispot','Chillispot')?&gt;&lt;\/li&gt; --&gt; &lt;!--   &lt;li class=&quot;radius&quot;&gt;&lt;?=anchor('admin\/freeradius','FreeRadius')?&gt;&lt;\/li&gt; --&gt; <\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c phpMyAdmin, \u044d\u0442\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u0440\u043e\u0434\u0430 GUI \u0434\u043b\u044f MySQL, \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446:<\/p>\n<pre><code class=\"bash\">wget https:\/\/files.phpmyadmin.net\/phpMyAdmin\/3.5.5\/phpMyAdmin-3.5.5-all-languages.zip unzip phpMyAdmin-3.5.5-all-languages.zip cp  phpMyAdmin-3.5.5-all-languages EasyHotspot\/htdocs\/phpmyadmin -rf <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c config.inc.php:<\/p>\n<pre><code class=\"bash\">vi EasyHotspot\/htdocs\/phpmyadmin\/config.inc.php <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"php\">&lt;?php   $i = 0;   $i++;   $cfg['ThemeDefault'] = 'original';   $cfg['Servers'][$i]['host'] = 'localhost';   $cfg['Servers'][$i]['extension'] = 'mysqli';   $cfg['Servers'][$i]['connect_type'] = 'tcp';   $cfg['Servers'][$i]['compress'] = false;   $cfg['Servers'][$i]['auth_type'] = 'config'; \/\/  - phpmyadmin \u0441\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043b\u043e\u0433\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u0411\u0414. \u0415\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c, \u0447\u0442\u043e\u0431 \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u043e\u0441\u044c \u043e\u043a\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, 'config' \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 'http'    $cfg['Servers'][$i]['user'] = 'easyhotspot';   $cfg['Servers'][$i]['password'] = 'easyhotspot';      \/* End of servers configuration *\/  $cfg['UploadDir'] = ''; $cfg['SaveDir'] = ''; $cfg['BZipDump'] = false; $cfg['DefaultLang'] = 'ru'; $cfg['ThemeDefault'] = 'original'; $cfg['ServerDefault'] = 1; $cfg['CompressOnFly'] = false; $cfg['UserprefsDeveloperTab'] = true; $cfg['HideStructureActions'] = false; $cfg['LoginCookieDeleteAll'] = false; $cfg['QueryHistoryDB'] = true; $cfg['RetainQueryBox'] = true; $cfg['blowfish_secret'] = '51a360783193d3.45092927'; $cfg['LeftDefaultTabTable'] = 'tbl_select.php'; $cfg['MaxTableList'] = 500;  ?&gt; <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c Apache:<\/p>\n<pre><code class=\"bash\">service httpd restart <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 FreeRadius<\/h4>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0444\u0440\u0438\u0440\u0430\u0434\u0438\u0443\u0441, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 mysql \u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u043c \u0432 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b:<\/p>\n<pre><code class=\"bash\">yum install freeradius freeradius-mysql freeradius-utils <\/code><\/pre>\n<p>  \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431 freeradiu \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438:<\/p>\n<pre><code class=\"bash\">chkconfig --level 235 radiusd on <\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/clients.conf \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u201cclient localhost\u201c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\">ipaddr = 127.0.0.1 secret = easyhotspot nastype = other <\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/radiusd.conf \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u201cmodule\u201d \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"bash\">$INCLUDE sql.conf $INCLUDE sql\/mysql\/counter.conf <\/code><\/pre>\n<p>  \u0412 \u0441\u0435\u043a\u0446\u0438\u0438 \u201cinstantiate\u201c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c:<\/p>\n<pre><code class=\"bash\">noresetcounter <\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sites-enabled\/default \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u201cauthorize\u201d \u0440\u0430\u0441\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u201csql\u201d \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u00abnoresetcounter\u00bb:<\/p>\n<pre><code class=\"bash\">sql noresetcounter <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \/etc\/raddb\/sites-enabled\/default \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u201caccounting\u201d \u0440\u0430\u0441\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u201csql\u201d:<\/p>\n<pre><code class=\"bash\">sql <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \/etc\/raddb\/sites-enabled\/default \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u201csession\u201d \u0440\u0430\u0441\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u201csql\u201d \u0438 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u00abradutmp\u00bb:<\/p>\n<pre><code class=\"bash\">sql #radutmp <\/code><\/pre>\n<p>  \u0418 \u0437\u0430\u0442\u0435\u043c \/etc\/raddb\/sites-enabled\/default \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u00abpost-auth\u00bb \u0440\u0430\u0441\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u201csql\u201d:<\/p>\n<pre><code class=\"bash\">sql  <\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sql\/mysql\/counter.conf \u0432 \u043a\u043e\u043d\u0446\u0435 \u0443\u0436\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u00abnoresetcounter\u00bb, \u043c\u044b \u0435\u0433\u043e \u043f\u043e\u0434\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c:<\/p>\n<pre><code class=\"bash\">sqlcounter noresetcounter { counter-name = Session-Timeout check-name = Session-Timeout reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = never query = &quot;SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='%{${key}}'&quot; }  <\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sql\/mysql\/dialup.conf \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Simultaneous-Use \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\">simul_count_query = &quot;SELECT COUNT(*) \\    FROM ${acct_table1} \\    WHERE username = '%{SQL-User-Name}' \\    AND acctstoptime IS NULL&quot; <\/code><\/pre>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sql.conf \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u00absql\u00bb \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">        database = &quot;mysql&quot;         driver = &quot;rlm_sql_${database}&quot;         server = &quot;localhost&quot;         #port = 3306         login = &quot;easyhotspot&quot;         password = &quot;easyhotspot&quot;         radius_db = &quot;easyhotspot_opensource&quot; <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c freeRadius:<\/p>\n<pre><code class=\"bash\">service radiusd start <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0421isco WLC<\/h4>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c Radius-\u0441\u0435\u0440\u0432\u0435\u0440 \u043a WLC: SECURITY-&gt;Authentication. SECURITY-&gt;Accounting. \u041f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 IP \u0438 Shared Secret.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a74\/d6e\/ae6\/a74d6eae6c1945a694116cf1df086153.jpg\"\/><\/p>\n<p>  \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043b\u044e\u0431\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0440\u043e\u043b\u044c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6e4\/e34\/be1\/6e4e34be190f486abb48dce7264fe6ad.jpg\"\/><\/p>\n<p>  \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c access-list. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a SSID, \u0432\u0441\u0435\u0433\u043e \u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u0437 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u044f\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u043a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e \u0435\u0433\u043e \u043f\u043e \u0441\u0443\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442.<\/p>\n<p>  \u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c ACL, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043d\u0438\u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f0a\/7bc\/55f\/f0a7bc55fa064c2caca62d3f8a2eaabf.jpg\"\/><\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c SSID, \u043d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Security-&gt;Layer 2 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c None. \u041d\u0430 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Security-&gt;Layer 3 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Web Policy \u2014 Authentication, \u0432 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435 Preauthentication ACL \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0430\u0448 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 ACL.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f76\/d58\/5a9\/f76d585a9f4b40c48f48ee8e7e185b20.jpg\"\/><\/p>\n<p>  \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0438\u0437 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0440\u0430\u043d\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0440\u0430\u0434\u0438\u0443\u0441\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/25f\/20e\/2e2\/25f20e2e245149988a97ae98bd76ef25.jpg\"\/><\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0430\u0434\u0438\u0443\u0441. \u0414\u043e\u0431\u0430\u0432\u0438\u043c IP-\u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e WLC \u0438 secret<br \/>  vi \/etc\/raddb\/clients.conf<\/p>\n<pre><code class=\"bash\">client 192.168.0.5 { #       # secret and password are mapped through the &quot;secrets&quot; file.         secret      = ololo,karl! #       shortname   = liv1 #       # the following three fields are optional, but may be used by #       # checkrad.pl for simultaneous usage checks         nastype     = cisco #       login       = !root #       password    = someadminpas } <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c freeRadius:<\/p>\n<pre><code class=\"bash\">service radiusd restart  <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/\u0445.\u0445.\u0445.\u0445\/easyhotspot\">\u0445.\u0445.\u0445.\u0445\/easyhotspot<\/a> \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/480\/f75\/45f\/480f7545f1964419bb5c7827864696e7.jpg\"\/><\/p>\n<p>  \u041b\u043e\u0433\u0438\u043d: admin<br \/>  \u041f\u0430\u0440\u043e\u043b\u044c: admin123<\/p>\n<p>  \u041d\u0430 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043c\u0435\u043d\u044e [ Cashier Menu ] \u0438 [ Admin Menu ].<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/9b1\/81e\/07f\/9b181e07f0334222b880c375c247dd01.jpg\"\/><\/p>\n<p>  \u0412 Admin Menu \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c Billing plan \u0438 Account plan, \u0447\u0442\u043e\u0431\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0438\u0445 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043d\u044b\/\u043f\u0430\u0440\u043e\u043b\u0438. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0431\u0438\u043b\u043b\u0438\u043d\u0433 \u043f\u043b\u0430\u043d \u043d\u0430 \u0447\u0430\u0441, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0430\u0443\u0447\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u0435\u043d \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u043d\u044f \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f(Valid for = 1), \u0430 Idle Timeout \u0441\u0434\u0435\u043b\u0430\u0435\u043c 5 \u043c\u0438\u043d.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/9cf\/c08\/6ba\/9cfc086ba576414a9263901d8c9ba21c.jpg\"\/><\/p>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 [ Cashier Menu ] -&gt; Voucher Management \u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043e\u0434\u0438\u043d \u0432\u0430\u0443\u0447\u0435\u0440.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/381\/fc8\/06f\/381fc806ff894973a96557e5a3037d8c.jpg\"\/><\/p>\n<p>  \u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b radtest \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0440\u0430\u0434\u0438\u0443\u0441-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 NAS. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u043d\/\u043f\u0430\u0440\u043e\u043b\u044c, &#8216;easyhotspot&#8217; \u044d\u0442\u043e secret \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/clients.conf:<\/p>\n<pre><code class=\"bash\">radtest zupvez10 palkipud 127.0.0.1 100 easyhotspot <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0443 \u0432\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<pre><code class=\"bash\">[root@FreeRadius ~]# radtest zupvez10 palkipud 127.0.0.1 100 esyhotspot radclient:: Failed to find IP address for FreeRadius radclient: Nothing to send. [root@FreeRadius ~]# <\/code><\/pre>\n<p>  \u0421\u0432\u044f\u0437\u0430\u043d\u0430 \u043e\u043d\u0430 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0440\u0430\u0434\u0438\u0443\u0441-\u043f\u0430\u043a\u0435\u0442\u0430 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u043e\u043b\u0432\u0438\u0442\u044c \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 NAS-IP-Address. \u0415\u0441\u043b\u0438 \u0438\u043c\u044f \u043d\u0435 localhost, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \/etc\/hosts. \u0418\u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">[root@FreeRadius ~]# radtest zupvez10 palkipud 127.0.0.1 100 easyhotspot Sending Access-Request of id 189 to 127.0.0.1 port 1812         User-Name = &quot;zupvez10&quot;         User-Password = &quot;palkipud&quot;         NAS-IP-Address = 127.0.0.1         NAS-Port = 100         Message-Authenticator = 0x00000000000000000000000000000000 rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=189, length=63         WISPr-Session-Terminate-Time = &quot;2016-1-6T24:00:00&quot;         Session-Timeout = 3600         Idle-Timeout = 300         Acct-Interim-Interval = 120 [root@FreeRadius ~]# <\/code><\/pre>\n<p>  \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0448\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0430\u0431\u043e\u0440 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432:<\/p>\n<ul>\n<li>WISPr-Session-Terminate-Time = \u00ab2016-1-6T24:00:00\u00bb \u2014 \u0432 \u043f\u043e\u043b\u043d\u043e\u0447\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u043d\u044f \u0441\u0435\u0441\u0441\u0438\u044f \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439<\/li>\n<li>Session-Timeout = 3600 \u2014 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e NAS \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u044e\u0437\u0435\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u0447\u0430\u0441<\/li>\n<li>Idle-Timeout = 300 \u2014 \u0435\u0441\u043b\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 5 \u043c\u0438\u043d \u044e\u0437\u0435\u0440 \u043d\u0435 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, NAS \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043a\u0438\u043d\u0443\u0442\u044c \u0441\u0435\u0441\u0441\u0438\u044e<\/li>\n<li>Acct-Interim-Interval = 120 \u043a\u0430\u0436\u0434\u044b\u0435 \u0434\u0432\u0435 \u043c\u0438\u043d\u0443\u0442\u044b NAS \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u0430(interim-update) \u0441 \u043e\u0442\u0447\u0435\u0442\u043e\u043c \u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0434\u0435\u043b\u0430\u0445 \u044e\u0437\u0435\u0440\u0430<\/li>\n<\/ul>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043d\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u0440\u0430\u0431\u043e\u0442\u044b NAS, \u043f\u043e\u0441\u043b\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0434\u0442\u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0440\u0438 \u0444\u0430\u0439\u043b\u0430 \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438. \u0412 \u043f\u043e\u043b\u0435 User-Name = &quot;&quot; \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0430\u0448 username.<\/p>\n<p>  vi start.txt:<\/p>\n<pre><code class=\"bash\">Packet-Type=4 Packet-Dst-Port=1813 Acct-Session-Id = &quot;4D2BB8AC-00000098&quot; Acct-Status-Type = Start Acct-Authentic = RADIUS User-Name = &quot;zupvez10&quot;  NAS-Port = 0 Called-Station-Id = &quot;00-02-6F-AA-AA-AA:My Wireless&quot; Calling-Station-Id = &quot;00-1C-B3-AA-AA-AA&quot; NAS-Port-Type = Wireless-802.11 Connect-Info = &quot;CONNECT 48Mbps 802.11b&quot; <\/code><\/pre>\n<p>  \u0412 \u043f\u043e\u043b\u0435 User-Name = &quot;&quot; \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0430\u0448 username.<\/p>\n<p>  vi interim-update.txt:<\/p>\n<pre><code class=\"bash\">Packet-Type=4 Packet-Dst-Port=1813 Acct-Session-Id = &quot;4D2BB8AC-00000098&quot; Acct-Status-Type = Interim-Update Acct-Authentic = RADIUS User-Name = &quot;zupvez10&quot;  NAS-Port = 0 Called-Station-Id = &quot;00-02-6F-AA-AA-AA:My Wireless&quot; Calling-Station-Id = &quot;00-1C-B3-AA-AA-AA&quot; NAS-Port-Type = Wireless-802.11 Connect-Info = &quot;CONNECT 48Mbps 802.11b&quot; Acct-Session-Time = 11 Acct-Input-Packets = 15 Acct-Output-Packets = 3 Acct-Input-Octets = 1407 Acct-Output-Octets = 467 <\/code><\/pre>\n<p>  \u0412 \u043f\u043e\u043b\u0435 User-Name = &quot;&quot; \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0430\u0448 username.<\/p>\n<p>  vi stop.txt:<\/p>\n<pre><code class=\"bash\">Packet-Type=4 Packet-Dst-Port=1813 Acct-Session-Id = &quot;4D2BB8AC-00000098&quot; Acct-Status-Type = Stop Acct-Authentic = RADIUS User-Name = &quot;zupvez10&quot;  NAS-Port = 0 Called-Station-Id = &quot;00-02-6F-AA-AA-AA:My Wireless&quot; Calling-Station-Id = &quot;00-1C-B3-AA-AA-AA&quot; NAS-Port-Type = Wireless-802.11 Connect-Info = &quot;CONNECT 48Mbps 802.11b&quot; Acct-Session-Time = 30 Acct-Input-Packets = 25 Acct-Output-Packets = 7 Acct-Input-Octets = 3407 Acct-Output-Octets = 867 Acct-Terminate-Cause = User-Request <\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b radclient \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0440\u0430\u0434\u0438\u0443\u0441-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043f\u0430\u043a\u0435\u0442 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u0430 Start.<\/p>\n<p>  radclient 127.0.0.1 auto easyhotspot -f start.txt:<\/p>\n<pre><code class=\"bash\">[root@FreeRadius ~]# radclient 127.0.0.1 auto easyhotspot -f start.txt Received response ID 50, code 5, length = 20 <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0435\u043d \u043e\u0442\u0432\u0435\u0442, code 5 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 [ Cashier Menu ] -&gt; Online Users.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ec7\/8c8\/666\/ec78c866625946d38d17ab03302ba587.jpg\"\/><\/p>\n<p>  \u0412\u0438\u0434\u0438\u043c \u043d\u0430\u0448\u0435\u0433\u043e \u044e\u0437\u0435\u0440\u0430 \u0438 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0435\u0441\u0441\u0438\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u0430 interim-update. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0432 \u043f\u0430\u043a\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b:<\/p>\n<ul>\n<li>Acct-Session-Time = 11<\/li>\n<li>Acct-Input-Packets = 15<\/li>\n<li>Acct-Output-Packets = 3<\/li>\n<li>Acct-Input-Octets = 1407<\/li>\n<li>Acct-Output-Octets = 467<\/li>\n<\/ul>\n<p>  radclient 127.0.0.1 auto easyhotspot -f interim-update.txt:<\/p>\n<pre><code class=\"bash\">[root@FreeRadius ~]# radclient 127.0.0.1 auto easyhotspot -f interim-update.txt Received response ID 226, code 5, length = 20 <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c Online Users.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0f9\/937\/e6c\/0f9937e6cfa5470f9b5b2870ed1c054d.jpg\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u044e\u0437\u0435\u0440 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0438\u0437 \u043e\u0442\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0435\u043c\u0443 \u0447\u0430\u0441\u0430 11 \u0441\u0435\u043a\u0443\u043d\u0434 \u0438 1874 \u0431\u0430\u0439\u0442\u0430. \u041e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u0430 stop.<\/p>\n<p>  radclient 127.0.0.1 auto easyhotspot -f stop.txt:<\/p>\n<pre><code class=\"bash\">[root@FreeRadius ~]# radclient 127.0.0.1 auto easyhotspot -f stop.txt Received response ID 166, code 5, length = 20 <\/code><\/pre>\n<p>  \u0421\u0435\u0441\u0441\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0432 [ Cashier Menu ] -&gt; Voucher Management.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a75\/e58\/8d7\/a75e588d72e142ca9db529e46ece1d6b.jpg\"\/><\/p>\n<p>  \u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c 59 \u043c\u0438\u043d. \u0412\u0440\u0435\u043c\u044f \u043e\u043a\u0440\u0443\u0433\u043b\u0438\u043b\u043e\u0441\u044c, \u043d\u043e \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u0435, freeRadius \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c:<\/p>\n<p>  radtest zupvez10 palkipud 127.0.0.1 100 easyhotspot:<\/p>\n<pre><code class=\"bash\">[root@FreeRadius ~]# radtest zupvez10 palkipud 127.0.0.1 100 easyhotspot Sending Access-Request of id 93 to 127.0.0.1 port 1812         User-Name = &quot;zupvez10&quot;         User-Password = &quot;palkipud&quot;         NAS-IP-Address = 127.0.0.1         NAS-Port = 100         Message-Authenticator = 0x00000000000000000000000000000000 rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=93, length=63         WISPr-Session-Terminate-Time = &quot;2016-1-6T24:00:00&quot;         Session-Timeout = 3570         Idle-Timeout = 300         Acct-Interim-Interval = 120 <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430, freeRadius \u043e\u0442 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 3600 \u043e\u0442\u043d\u044f\u043b \u043f\u043e\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u044e\u0437\u0435\u0440\u043e\u043c 30 \u0438 \u0432\u0435\u0440\u043d\u0443\u043b \u043d\u0430\u043c 3570. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0448\u043b\u0435\u043c \u043f\u0430\u043a\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0435\u0441\u0441\u0438\u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u0430.<\/p>\n<p>  radclient 127.0.0.1 auto easyhotspot -f start.txt:<\/p>\n<pre><code class=\"bash\">[root@FreeRadius ~]# radclient 127.0.0.1 auto easyhotspot -f start.txt Received response ID 15, code 5, length = 20 <\/code><\/pre>\n<p>  \u0418 \u0437\u0430\u043d\u043e\u0432\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0432 \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u0430\u043b \u0441\u0432\u043e\u0438 \u043a\u0440\u0435\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044b \u0434\u0440\u0443\u0433\u0443.<\/p>\n<p>  radtest zupvez10 palkipud 127.0.0.1 100 easyhotspot:<\/p>\n<pre><code class=\"bash\">Sending Access-Request of id 99 to 127.0.0.1 port 1812         User-Name = &quot;zupvez10&quot;         User-Password = &quot;palkipud&quot;         NAS-IP-Address = 127.0.0.1         NAS-Port = 100         Message-Authenticator = 0x00000000000000000000000000000000 rad_recv: Access-Reject packet from host 127.0.0.1 port 1812, id=99, length=68         Reply-Message = &quot;\\r\\nYou are already logged in - access denied\\r\\n\\n&quot; <\/code><\/pre>\n<p>  \u0411\u043e\u043b\u0442! \u041f\u043e\u043a\u0430 \u0441\u0435\u0441\u0441\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442. \u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043c \u0441\u0435\u0441\u0441\u0438\u044e.<\/p>\n<p>  radclient 127.0.0.1 auto easyhotspot -f stop.txt:<\/p>\n<pre><code class=\"bash\">[root@FreeRadius ~]# radclient 127.0.0.1 auto easyhotspot -f stop.txt Received response ID 143, code 5, length = 20 <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 freeRadius, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441. \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c freeRadius:<\/p>\n<pre><code class=\"bash\">service radiusd stop <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c freeRadius \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432\u044b\u0434\u0430\u0447\u0443 \u0432 \u0444\u0430\u0439\u043b log.txt \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<p>  radiusd -X &gt; log.txt &#038;<\/p>\n<p>  \u041f\u043e\u0448\u043b\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>  radtest zupvez10 palkipud 127.0.0.1 100 easyhotspot<\/p>\n<p>  \u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430 \u0441\u0435\u0441\u0438\u0438:<\/p>\n<p>  radclient 127.0.0.1 auto easyhotspot -f start.txt<br \/>  radclient 127.0.0.1 auto easyhotspot -f interim-update.txt<br \/>  radclient 127.0.0.1 auto easyhotspot -f stop.txt<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0440\u0435\u0436\u0438\u043c \u043e\u0442\u043b\u0430\u0434\u043a\u0438.<\/p>\n<p>  kill \u2014 \u0443 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0432\u044b\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b radiusd -X &gt; log.txt &#038;<\/p>\n<pre><code class=\"bash\">[root@FreeRadius ~]# service radiusd stop Stopping radiusd:                                          [  OK  ] [root@FreeRadius ~]# radiusd -X &gt; log.txt & [1] 4215 [root@FreeRadius ~]# radtest zupvez10 palkipud 127.0.0.1 100 easyhotspot Sending Access-Request of id 200 to 127.0.0.1 port 1812         User-Name = &quot;zupvez10&quot;         User-Password = &quot;palkipud&quot;         NAS-IP-Address = 127.0.0.1         NAS-Port = 100         Message-Authenticator = 0x00000000000000000000000000000000 rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=200, length=63         WISPr-Session-Terminate-Time = &quot;2016-1-6T24:00:00&quot;         Session-Timeout = 3540         Idle-Timeout = 300         Acct-Interim-Interval = 120 [root@FreeRadius ~]# radclient 127.0.0.1 auto easyhotspot -f start.txt Received response ID 68, code 5, length = 20 [root@FreeRadius ~]# radclient 127.0.0.1 auto easyhotspot -f interim-update.txt Received response ID 142, code 5, length = 20 [root@FreeRadius ~]# radclient 127.0.0.1 auto easyhotspot -f stop.txt Received response ID 37, code 5, length = 20 [root@FreeRadius ~]# kill 4215 [root@FreeRadius ~]# kill 4215 bash: kill: (4215) - No such process [1]+  Done                    radiusd -X &gt; log.txt <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u043e\u0433:<\/p>\n<pre><code class=\"bash\">less log.txt <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">debug_Authentication and authorization<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">rad_recv: Access-Request packet from host 127.0.0.1 port 50024, id=200, length=78         User-Name = &quot;zupvez10&quot;         User-Password = &quot;palkipud&quot;         NAS-IP-Address = 127.0.0.1         NAS-Port = 100         Message-Authenticator = 0x9159a59b8e5c58fe44a95a199f84f9cf # Executing section authorize from file \/etc\/raddb\/sites-enabled\/default +group authorize { ++[preprocess] = ok ++[chap] = noop ++[mschap] = noop ++[digest] = noop [suffix] No '@' in User-Name = &quot;zupvez10&quot;, looking up realm NULL [suffix] No such realm &quot;NULL&quot; ++[suffix] = noop [eap] No EAP-Message, not doing EAP ++[eap] = noop ++[files] = noop [sql]   expand: %{User-Name} -&gt; zupvez10 [sql] sql_set_user escaped user --&gt; 'zupvez10' rlm_sql (sql): Reserving sql socket id: 31 [sql]   expand: SELECT id, username, attribute, value, op           FROM radcheck           WHERE username = '%{SQL-User-Name}'           ORDER BY id -&gt; SELECT id, username, attribute, value, op         FROM radcheck           WHERE username = 'zupvez10'           ORDER BY id [sql] User found in radcheck table [sql]   expand: SELECT id, username, attribute, value, op           FROM radreply           WHERE username = '%{SQL-User-Name}'           ORDER BY id -&gt; SELECT id, username, attribute, value, op         FROM radreply           WHERE username = 'zupvez10'           ORDER BY id [sql]   expand: SELECT groupname           FROM radusergroup           WHERE username = '%{SQL-User-Name}'           ORDER BY priority -&gt; SELECT groupname           FROM radusergroup           WHER E username = 'zupvez10'           ORDER BY priority [sql]   expand: SELECT id, groupname, attribute,           Value, op           FROM radgroupcheck           WHERE groupname = '%{Sql-Group}'           ORDER BY id -&gt; SELECT id, groupname, attribute ,           Value, op           FROM radgroupcheck           WHERE groupname = '1hour'           ORDER BY id [sql] User found in group 1hour [sql]   expand: SELECT id, groupname, attribute,           value, op           FROM radgroupreply           WHERE groupname = '%{Sql-Group}'           ORDER BY id -&gt; SELECT id, groupname, attribute ,           value, op           FROM radgroupreply           WHERE groupname = '1hour'           ORDER BY id rlm_sql (sql): Released sql socket id: 31 ++[sql] = ok rlm_sqlcounter: Entering module authorize code sqlcounter_expand:  'SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='%{User-Name}'' [noresetcounter]        expand: SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='%{User-Name}' -&gt; SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='zupvez10' WARNING: Please replace '%S' with '${sqlmod-inst}' sqlcounter_expand:  '%{sql:SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='zupvez10'}' [noresetcounter] sql_xlat [noresetcounter]        expand: %{User-Name} -&gt; zupvez10 [noresetcounter] sql_set_user escaped user --&gt; 'zupvez10' [noresetcounter]        expand: SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='zupvez10' -&gt; SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='zupvez10' rlm_sql (sql): Reserving sql socket id: 30 [noresetcounter] sql_xlat finished rlm_sql (sql): Released sql socket id: 30 [noresetcounter]        expand: %{sql:SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='zupvez10'} -&gt; 60 rlm_sqlcounter: Check item is greater than query result rlm_sqlcounter: Authorized user zupvez10, check_item=3600, counter=60 rlm_sqlcounter: Sent Reply-Item for user zupvez10, Type=Session-Timeout, value=3540 ++[noresetcounter] = ok [expiration] Checking Expiration time: 'January 6 2016 24:00:00' ++[expiration] = ok ++[logintime] = noop ++[pap] = updated +} # group authorize = updated Found Auth-Type = PAP # Executing group from file \/etc\/raddb\/sites-enabled\/default +group PAP { [pap] login attempt with password &quot;palkipud&quot; [pap] Using clear text password &quot;palkipud&quot; [pap] User authenticated successfully ++[pap] = ok +} # group PAP = ok # Executing section session from file \/etc\/raddb\/sites-enabled\/default +group session { [sql]   expand: %{User-Name} -&gt; zupvez10 [sql] sql_set_user escaped user --&gt; 'zupvez10' [sql]   expand: SELECT COUNT(*)                              FROM radacct                              WHERE username = '%{SQL-User-Name}'                              AND acctstoptime IS NULL -&gt; SELECT COUNT(*)                              FROM radacct                              WHERE username = 'zupvez10'                              AND acctstoptime IS NULL rlm_sql (sql): Reserving sql socket id: 29 rlm_sql (sql): Released sql socket id: 29 ++[sql] = ok +} # group session = ok # Executing section post-auth from file \/etc\/raddb\/sites-enabled\/default +group post-auth { [sql]   expand: %{User-Name} -&gt; zupvez10 [sql] sql_set_user escaped user --&gt; 'zupvez10' [sql]   expand: %{User-Password} -&gt; palkipud [sql]   expand: INSERT INTO radpostauth                           (username, pass, reply, authdate)                           VALUES (                           '%{User-Name}',                           '%{%{User-Password}:-%{Chap-Password}}',                           '%{reply:Packet-Type}', '%S') -&gt; INSERT INTO radpostauth                           (username, pass, reply, authdate)                           VALUES (                           'zupvez10',                           'palkipud',                           'Access-Accept', '2016-01-05 21:20:45') rlm_sql (sql) in sql_postauth: query is INSERT INTO radpostauth                           (username, pass, reply, authdate)                           VALUES (                           'zupvez10',                           'palkipud',                           'Access-Accept', '2016-01-05 21:20:45') rlm_sql (sql): Reserving sql socket id: 28 rlm_sql (sql): Released sql socket id: 28 ++[sql] = ok ++[exec] = noop +} # group post-auth = ok Sending Access-Accept of id 200 to 127.0.0.1 port 50024         WISPr-Session-Terminate-Time := &quot;2016-1-6T24:00:00&quot;         Session-Timeout := 3540         Idle-Timeout := 300         Acct-Interim-Interval := 120 Finished request 0. Going to the next request <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  FreeRadius \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043d\u0430\u0448 \u043f\u0430\u043a\u0435\u0442 \u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0441\u0435\u043a\u0446\u0438\u044e <b>authorize<\/b>, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sites-enabled\/default<br \/>  \u0412 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u043c\u043e\u0434\u0443\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441. <\/p>\n<ul>\n<li>[preprocess] \u2014 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 raddb\/huntgroups \u0438 raddb\/hints, \u043c\u044b \u0435\u0433\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c<\/li>\n<li>[chap] [mschap] [eap] [pap] \u2014 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043b\u0438\u043d\u043d\u043e\u0441\u0442\u0438, \u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 freeRadius \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043a\u0430\u043a\u043e\u0439 \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 authorize \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0432\u0441\u0435<\/li>\n<li>[digest] \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f Cisco SIP server, \u043d\u0430\u043c \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u043d\u0443\u0436\u0435\u043d<\/li>\n<li>[suffix] \u2014 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0430\u0440\u0441\u0438\u0442 User-Name \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 realm&#8217;\u0430, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/li>\n<li>[files] \u2014 \u043f\u0430\u0440\u0441\u0438\u0442 \u0444\u0430\u0439\u043b \/raddb\/users \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u044e\u0437\u0435\u0440\u043e\u0432, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043e\u043d \u0431\u0435\u0437\u0440\u0430\u0437\u043b\u0438\u0447\u0435\u043d<\/li>\n<li>[sql] \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u044e\u0437\u0435\u0440\u0430 \u0438 \u0435\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0441\u0430\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sql\/mysql\/dialup.conf<\/li>\n<\/ul>\n<p>  \u0418\u0437 \u0432\u044b\u0434\u0430\u0447\u0438 \u0434\u0435\u0431\u0430\u0433\u0430 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0411\u0414 \u043a \u043f\u044f\u0442\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0445 \u043f\u043e\u0437\u0436\u0435, \u0430 \u043f\u043e\u043a\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d \u0438 \u0432\u0441\u0435 \u043e\u043a:<\/p>\n<ul>\n<li>[noresetcounter] \u2014 \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c, \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sql\/mysql\/counter.conf<\/li>\n<li>[expiration] \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 expiration, \u0435\u0441\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u0440\u0435\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b \u0432\u044b\u0448\u043b\u043e, \u0442\u043e \u043d\u0435\u0432\u0430\u0436\u043d\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043e\u0442\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0441\u043f\u0435\u043b \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c, \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0430\u0437\u0430\u043d\u043e<\/li>\n<li>[logintime] \u2014 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u0433\u0434\u0430 \u043a\u0440\u0435\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u043e\u0431\u0435\u0434 \u043f\u043e \u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430\u043c<\/li>\n<li>[pap] \u2014 Found Auth-Type = PAP \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u0434\u043b\u0438\u043d\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d<\/li>\n<\/ul>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u0435\u043a\u0446\u0438\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0442\u0443\u0442 [pap] \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0447\u0442\u043e User authenticated successfully. \u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u043a\u0446\u0438\u044f <b>section<\/b>, \u0432 \u043d\u0435\u0439 [sql] \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f, \u0430\u043a\u0442\u0438\u0432\u043d\u0430 \u043b\u0438 \u0441\u0435\u0441\u0441\u0438\u044f \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0435\u0441\u043b\u0438 \u0434\u0430, \u0437\u043d\u0430\u0447\u0438\u0442 \u043a\u0442\u043e-\u0442\u043e \u0443\u0436\u0435 \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0438\u043b\u0441\u044f \u0438 \u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0430\u0437\u0430\u043d\u043e. \u0421\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sql\/mysql\/dialup.conf. \u0421\u0435\u043a\u0446\u0438\u044f <b>post-auth<\/b> \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u0443\u044e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 radpostauth. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 freeRadius \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0448\u0435\u0441\u0442\u044c\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438:<\/p>\n<ul>\n<li>radcheck<\/li>\n<li>radreply<\/li>\n<li>radusergroup<\/li>\n<li>radgroupcheck<\/li>\n<li>radgroupreply<\/li>\n<li>radpostauth<\/li>\n<\/ul>\n<p>  \u0410\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430, \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0441 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u043e\u043c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">debug_Accounting<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">rad_recv: Accounting-Request packet from host 127.0.0.1 port 58851, id=142, length=177         Acct-Session-Id = &quot;4D2BB8AC-00000098&quot;         Acct-Status-Type = Interim-Update         Acct-Authentic = RADIUS         User-Name = &quot;zupvez10&quot;         NAS-Port = 0         Called-Station-Id = &quot;00-02-6F-AA-AA-AA:My Wireless&quot;         Calling-Station-Id = &quot;00-1C-B3-AA-AA-AA&quot;         NAS-Port-Type = Wireless-802.11         Connect-Info = &quot;CONNECT 48Mbps 802.11b&quot;         Acct-Session-Time = 11         Acct-Input-Packets = 15         Acct-Output-Packets = 3         Acct-Input-Octets = 1407         Acct-Output-Octets = 467 # Executing section preacct from file \/etc\/raddb\/sites-enabled\/default +group preacct { ++[preprocess] = ok [acct_unique] WARNING: Attribute NAS-Identifier was not found in request, unique ID MAY be inconsistent [acct_unique] Hashing 'NAS-Port = 0,,NAS-IP-Address = 127.0.0.1,Acct-Session-Id = &quot;4D2BB8AC-00000098&quot;,User-Name = &quot;zupvez10&quot;' [acct_unique] Acct-Unique-Session-ID = &quot;55c4c93f54bb88a7&quot;. ++[acct_unique] = ok [suffix] No '@' in User-Name = &quot;zupvez10&quot;, looking up realm NULL [suffix] No such realm &quot;NULL&quot; ++[suffix] = noop ++[files] = noop +} # group preacct = ok # Executing section accounting from file \/etc\/raddb\/sites-enabled\/default +group accounting { [detail]        expand: %{Packet-Src-IP-Address} -&gt; 127.0.0.1 [detail]        expand: \/var\/log\/radius\/radacct\/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}\/detail-%Y%m%d -&gt; \/var\/log\/radius\/radacct\/127.0.0.1\/detail-20160105 [detail] \/var\/log\/radius\/radacct\/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}\/detail-%Y%m%d expands to \/var\/log\/radius\/radacct\/127.0.0.1\/detail-20160105 [detail]        expand: %t -&gt; Tue Jan  5 21:21:18 2016 ++[detail] = ok [sql]   expand: %{User-Name} -&gt; zupvez10 [sql] sql_set_user escaped user --&gt; 'zupvez10' [sql]   expand: %{Acct-Session-Time} -&gt; 11 [sql]   expand: %{Acct-Input-Gigawords} -&gt; [sql]   ... expanding second conditional [sql]   expand: %{Acct-Input-Octets} -&gt; 1407 [sql]   expand: %{Acct-Output-Gigawords} -&gt; [sql]   ... expanding second conditional [sql]   expand: %{Acct-Output-Octets} -&gt; 467 [sql]   expand:            UPDATE radacct           SET              framedipaddress = '%{Framed-IP-Address}',              acctsessiontime     = '%{%{Acct-Session-Time}:-0}',              acctinpu toctets     = '%{%{Acct-Input-Gigawords}:-0}'  &lt;&lt; 32 |                                    '%{%{Acct-Input-Octets}:-0}',              acctoutputoctets    = '%{%{Acct-Output-Gigawords}:-0}' &lt;&lt; 32 |                                   '%{%{Acct-Output-Octets}:-0}'           WHERE acctsessionid = '%{Acct-Session-Id}'           AND username        = '%{SQL-User-Name}'           AND nasipaddress    = '%{NAS-IP-Address}' -&gt;            UPDATE radacct           SET              framedipaddress = '',              acctsessiontime     = '11',              acctinputoctets     = '0'  &lt;&lt; 32 |                                    '1407',              acctoutputoctets    = '0' &lt;&lt; 32 |                                    '467'           WHERE acctsessionid = '4D2BB8AC-00000098'           AND username        = 'zupvez10'           AND nas rlm_sql (sql): Reserving sql socket id: 26 rlm_sql (sql): Released sql socket id: 26 ++[sql] = ok ++[exec] = noop [attr_filter.accounting_response]       expand: %{User-Name} -&gt; zupvez10 attr_filter: Matched entry DEFAULT at line 12 ++[attr_filter.accounting_response] = updated +} # group accounting = updated Sending Accounting-Response of id 142 to 127.0.0.1 port 58851 Finished request 2. Cleaning up request 2 ID 142 with timestamp +40 Going to the next request <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 Interim-Update. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u043a\u0446\u0438\u044f <b>preacct<\/b>, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sites-enabled\/default:<\/p>\n<ul>\n<li>[acct_unique] \u2014 \u0431\u0435\u0440\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 \u0438 \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0445\u044d\u0448, \u0434\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u0432 \u0411\u0414 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 radacct, \u043a\u0430\u043a acctuniqueid<\/li>\n<li>[suffix] \u2014 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0430\u0440\u0441\u0438\u0442 User-Name \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 realm&#8217;\u0430, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/li>\n<li>[files] \u2014 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043f\u043e \u0440\u0430\u0437\u043d\u043e\u043c\u0443 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/acct_users<\/li>\n<\/ul>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u043a\u0446\u0438\u044f <b>accounting<\/b>:<\/p>\n<ul>\n<li>[detail] \u2014 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b, \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \/etc\/raddb\/modules\/detail \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u044d\u0442\u0438 \u043b\u043e\u0433\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \/var\/log\/radius\/radacct\/127.0.0.1\/<\/li>\n<li>[sql] \u2014 \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 radacct, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 UPDATE, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c, \u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0430\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 start. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0442\u043a \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043e\u0434\u043d\u0430 \u0441\u0435\u0441\u0441\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u043d\u0443 \u0437\u0430\u043f\u0438\u0441\u044c \u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u043b\u044f \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u0430 \u0438 \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u0430\u043a [noresetcounter] \u0438 section.\u041d\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0430\u043a, \u0442\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sql\/mysql\/dialup.conf \u043a\u0440\u043e\u043c\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 accounting_update_query, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c, \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435 accounting_update_query_alt, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0444\u0435\u0439\u043b\u043e\u043c accounting_update_query \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c. <\/li>\n<li>[exec] \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/modules\/exec \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/li>\n<li>[attr_filter.accounting_response] \u2014 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/modules\/attr_filter<\/li>\n<\/ul>\n<p>  \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442. \u0418\u0442\u0430\u043a, \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u0430 freeRadius \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u0441 \u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439:<\/p>\n<ul>\n<li>radacct<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 MySQL<\/h4>\n<p>  \u041f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/\u0445.\u0445.\u0445.\u0445\/easyhotspot\/phpmyadmin\">\u0445.\u0445.\u0445.\u0445\/easyhotspot\/phpmyadmin<\/a> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430\u0448\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GUI. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0411\u0414 easyhotspot_opensource. \u041d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u043c\u044c \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u043b freeRadius:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/479\/ed3\/2a9\/479ed32a95454ec5a2c385420f7e0db1.jpg\"\/><\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u0436\u0434\u0443\u044e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u0447\u043d\u0435\u043c \u0441 radcheck.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/77e\/0b9\/677\/77e0b96778f64f218e6c3cb5dba5c20b.jpg\"\/><\/p>\n<p>  \u0422\u0443\u0442 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u044e\u0437\u0435\u0440\u0430. \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 Cleartext-Password \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u043e\u043b\u044c, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 Expiration \u0434\u0430\u0442\u0430 \u043f\u043e \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u0440\u0435\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u044b \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u044e\u0442 \u0431\u044b\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438.<\/p>\n<p>  \u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0432 \u043b\u043e\u0433\u0430\u0445 \u0434\u0435\u0431\u0430\u0433\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0441 \u043f\u0430\u0440\u043e\u043b\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c [pap] \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <b>authenticate<\/b>, \u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 Expiration \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c [expiration] \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 <b>authorize<\/b>.<\/p>\n<p>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u043b \u0434\u043b\u044f \u043d\u0430\u0441 \u043d\u0430\u0448 \u0431\u0438\u043b\u043b\u0438\u043d\u0433 easyhotspot. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 radcheck \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 radreply \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0432\u0435\u0442\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/cc0\/8e4\/789\/cc08e47890e9426d91750eee58c6c9dc.jpg\"\/><\/p>\n<p>  \u041d\u043e \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e WISPr-Session-Terminate-Time := \u00ab2016-1-6T24:00:00\u00bb. \u0412\u0441\u0435 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b. \u0415\u0441\u043b\u0438 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043e\u0431\u0449\u0438\u0439 \u0431\u0438\u043b\u043b\u0438\u043d\u0433-\u043f\u043b\u0430\u043d \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0437\u0430\u0447\u0435\u043c \u043d\u0430\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 radreply \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<br \/>  \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 radusergroup \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c username \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0432 groupname \u0435\u0433\u043e \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u044c \u043a \u0433\u0440\u0443\u043f\u043f\u0435 \u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/053\/45a\/a4f\/05345aa4fbea4b278fbf1201588f6c07.jpg\"\/><\/p>\n<p>  \u0410 \u0434\u0430\u043b\u044c\u0448\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 radgroupreply \u0432 groupname \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u044e \u0442\u0443 \u0436\u0435 \u0433\u0440\u0443\u043f\u043f\u0443 \u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u0442\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c, \u0447\u0442\u043e \u0432 \u043d\u0435\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/483\/a01\/fdf\/483a01fdf9f248cf9fb216c7148d5e7b.jpg\"\/><\/p>\n<p>  \u0418 \u0442\u0443\u0442 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0442\u0440\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u0438 \u043a \u043d\u0430\u043c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043e\u0442 freeRadius. \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0438\u043c\u0435\u0442\u044c \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438, \u043d\u043e \u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438? \u0422\u0443\u0442 \u043d\u0430\u043c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 radgroupcheck.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/112\/05c\/d41\/11205cd4162f431eacc8c48c02201a29.jpg\"\/><\/p>\n<p>  \u0412 \u043d\u0435\u0439 \u043c\u044b \u0432\u0438\u0434\u0438\u043c Session-Timeout, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c [noresetcounter] \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 authorize \u0438 Simultaneous-Use, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c [sql] \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 session. value = 1 \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0440\u0430\u0434\u0438\u0443\u0441\u0443 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u043d\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u0441\u0435\u0441\u0441\u0438\u044f, \u0432\u0441\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442\u043a\u0430\u0437.<\/p>\n<p>  \u0418 \u0432\u0441\u0435 \u044d\u0442\u043e \u0437\u0430 \u043d\u0430\u0441 \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0430\u0448 \u0431\u0438\u043b\u043b\u0438\u043d\u0433 easyhotspot. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0431\u0438\u043b\u043b\u0438\u043d\u0433-\u043f\u043b\u0430\u043d \u0438 \u043d\u0430\u0436\u0430\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0443 &#8216;Generate Voucher&#8217;, easyhotspot \u0440\u0430\u0441\u043a\u0438\u0434\u0430\u043b \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0441\u0430\u043c\u044b\u043c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 radpostauth \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u043e\u0434\u0443\u043b\u044f [sql] \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 post-auth \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u043b\u043e\u0433\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/be5\/0b4\/525\/be50b452503f429aae7cc1c63c5f9b79.jpg\"\/><\/p>\n<p>  \u0412\u0438\u0434\u0438\u043c \u0434\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430\u0448\u0438\u0445 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a. \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u0430\u044f \u043e\u0431\u044a\u0435\u043c\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 radacct, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f freeRadius&#8217;\u043e\u043c \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u0430. \u041a \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0448 \u0431\u0438\u043b\u043b\u0438\u043d\u0433 \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u043c \u043a\u0442\u043e \u0438\u0437 \u044e\u0437\u0435\u0440\u043e\u0432 \u043e\u043d\u043b\u0430\u0439\u043d, \u043a\u0442\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430. \u0422\u0430\u043a \u0436\u0435 \u043a \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0438 \u0441\u0430\u043c freeRadius \u0432 \u0442\u0435\u0445 \u0436\u0435 \u0446\u0435\u043b\u044f\u0445 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043e\u0442 NAS.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u0438\u043c\u0435\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u043b\u0435\u043d\u0438\u0435, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 NAS-freeRadius-MySQL-Easyhotspot \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u044b \u0443\u0432\u0438\u0434\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u0432 \u043c\u0435\u043d\u044e \u00abOnline Users\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/58a\/f62\/f07\/58af62f07e954c5d9a00884913b84ceb.jpg\"\/><\/p>\n<p>  \u041e\u0442\u043a\u0443\u0434\u0430 \u0432\u0437\u044f\u043b\u0438\u0441\u044c \u043c\u0430\u043a-\u0430\u0434\u0440\u0435\u0441\u0430, \u043c\u044b \u0436\u0435 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u044e\u0437\u0435\u0440\u043d\u0435\u0439\u043c\u043e\u0432? \u0412\u0441\u0435 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0446\u0438\u0441\u043a\u0430 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0440\u0430\u0437 \u043d\u0430\u043c \u0434\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\/\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430. \u0423 \u043d\u0430\u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 SSID, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044e\u0437\u0435\u0440 \u043f\u043e\u0434\u0446\u0435\u043f\u0438\u043b\u0441\u044f \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u0441\u044f, \u0446\u0438\u0441\u043a\u0430 \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u0430 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u043f\u043e\u043b\u0435 User-Name \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0442\u043e\u0442 username \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u043d \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u0441\u044f.<\/p>\n<p>  \u0410 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u0441\u044f? \u0422\u043e\u0433\u0434\u0430 \u0446\u0438\u0441\u043a\u0430 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u0430 \u0438 \u0432 \u043f\u043e\u043b\u0435 User-Name \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u0430\u043a-\u0430\u0434\u0440\u0435\u0441. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0446\u0435\u043f\u0438\u043b\u0438\u0441\u044c \u043a \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c\u0443 SSID \u0438 \u0432\u0438\u0441\u044f\u0442 \u0446\u0435\u043b\u044b\u043c\u0438 \u0434\u043d\u044f\u043c\u0438, \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044f \u043e\u0431 \u044d\u0442\u043e\u043c, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043d\u0430\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 radacct. \u0427\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043d\u0430\u0441 \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c freeRadius&#8217;\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"http:\/\/freeradius.org\/radiusd\/man\/unlang.html\">unlang<\/a> \u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A0%D0%B5%D0%B3%D1%83%D0%BB%D1%8F%D1%80%D0%BD%D1%8B%D0%B5_%D0%B2%D1%8B%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D1%8F\">\u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438<\/a>.<\/p>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sites-enabled\/default \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 preacct \u0432 \u0441\u0430\u043c\u043e\u043c \u0435\u0435 \u043d\u0430\u0447\u0430\u043b\u0435 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"bash\">#  Pre-accounting.  Decide which accounting type to use. # preacct {          if (User-Name=~ \/^[A-Fa-f0-9]{12}$\/) {                 reject         } <\/code><\/pre>\n<p>  \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c, \u0430\u0442\u0440\u0438\u0431\u0443\u0442 User-Name \u0440\u0430\u0432\u0435\u043d:<\/p>\n<ul>\n<li>&quot;~&quot; \u2014 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0432 \u0441\u0432\u043e\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043d\u043e \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u0435\u0448\u0430\u043c\u0438 &quot;\/\/&quot;<\/li>\n<li>&quot;^&quot; \u2014 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/li>\n<li>&quot;[A-Fa-f0-9]&quot; \u2014 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0441\u0438\u043c\u0432\u043e\u043b \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u0422\u0443\u0442 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f hex, \u0442.\u0435. \u043c\u0430\u043a-\u0430\u0434\u0440\u0435\u0441<\/li>\n<li>&quot;{12}&quot; \u2014 \u0432 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043c\u0430\u043a-\u0430\u0434\u0440\u0435\u0441 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0435\u043d\u0430\u0434\u0446\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/li>\n<li>&quot;$&quot; \u2014 \u043a\u043e\u043d\u0435\u0446 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/li>\n<\/ul>\n<p>  \u0418 \u0442\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u043e\u0439 \u043f\u0430\u043a\u0435\u0442 \u0436\u0434\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u00abreject\u00bb, \u0442\u043e \u0435\u0441\u0442\u044c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0434\u0440\u043e\u043f\u043d\u0443\u0442. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438:<\/p>\n<pre><code class=\"bash\">rad_recv: Accounting-Request packet from host 192.168.80.100 port 32770, id=138, length=246         User-Name = &quot;6c709f251ec4&quot;         NAS-Port = 13         NAS-IP-Address = 192.168.0.5         Framed-IP-Address = 192.168.13.80         NAS-Identifier = &quot;5508&quot;         Airespace-Wlan-Id = 2         Acct-Session-Id = &quot;567be2a8\/6c:70:9f:25:1e:c4\/217989&quot;         Acct-Authentic = Remote         Tunnel-Type:0 = VLAN         Tunnel-Medium-Type:0 = IEEE-802         Tunnel-Private-Group-Id:0 = &quot;13&quot;         Acct-Status-Type = Interim-Update         Acct-Input-Octets = 3566315         Acct-Output-Octets = 99562740         Acct-Input-Packets = 41757         Acct-Output-Packets = 66012         Acct-Session-Time = 8345         Acct-Delay-Time = 0         Calling-Station-Id = &quot;6c-70-9f-25-2\u0441-b2&quot;         Called-Station-Id = &quot;28-94-0f-ae-be-13&quot;         Cisco-AVPair = &quot;nas-update=true&quot; # Executing section preacct from file \/etc\/raddb\/sites-enabled\/default +- entering group preacct {...} ++? if (User-Name=~ \/^[A-Fa-f0-9]{12}$\/) ? Evaluating (User-Name=~ \/^[A-Fa-f0-9]{12}$\/) -&gt; TRUE ++? if (User-Name=~ \/^[A-Fa-f0-9]{12}$\/) -&gt; TRUE ++- entering if (User-Name=~ \/^[A-Fa-f0-9]{12}$\/) {...} +++[reject] returns reject ++- if (User-Name=~ \/^[A-Fa-f0-9]{12}$\/) returns reject Finished request 7. <\/code><\/pre>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u0440\u0435\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u043e\u0432 \u043c\u044b \u0441\u0430\u043c\u0438 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u0442\u044c \u043f\u043e\u0434 \u044d\u0442\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u0430 \u043c\u044b \u043e\u0442 \u043d\u0435\u0433\u043e \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u043c. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0448\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u00abOnline Users\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/31d\/c86\/16d\/31dc8616d97c49f19acebdaa2e1ac80c.jpg\"\/><\/p>\n<p>  \u041c\u0430\u043a-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0432 \u043d\u0435\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u044f\u0432\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u043b\u0438. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 radacct, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u00abdetpis7\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/661\/f59\/efd\/661f59efda3a4285b8baaa89dc1c027f.jpg\"\/><\/p>\n<p>  \u0410 \u0441 \u0435\u0433\u043e \u0441\u0435\u0441\u0441\u0438\u0435\u0439 \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u0432\u0441\u0435 \u0432\u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u0430\u0441\u044c 2015-12-24 18:18:00, \u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c 2015-12-24 19:11:37<br \/>  \u041f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u0442\u043e\u0433\u0434\u0430 \u0432\u0438\u0441\u0438\u0442 \u0443 \u043d\u0430\u0441 \u0432 \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u0435 \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0441\u0442\u0430\u0440\u0442\u0430 2015-12-24 18:18:00? \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0444\u0430\u0439\u043b\u0435 \/opt\/EasyHotspot\/htdocs\/system\/application\/models\/onlineusermodel.php:<\/p>\n<pre><code class=\"bash\">return $this-&gt;db-&gt;query('select username, MAX(acctstarttime) as start, (acctstoptime) as stop, sum(acctsessiontime) as time,sum(acctoutputoctets)+sum(acctinputoctets) as packet from radacct  where (acctstoptime IS NULL) group by username'); <\/code><\/pre>\n<p>  \u0418\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0435\u0441\u0441\u0438\u0438 \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0433\u0434\u0435 \u0432 acctstoptime \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e NULL. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u0430 \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e \u0434\u0432\u0443\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c.<\/p>\n<p>  \u0412\u043e \u043f\u0435\u0440\u0432\u044b\u0445 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043d\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u0430\u0445 \u043e\u0434\u043d\u0430 \u0441\u0435\u0441\u0441\u0438\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443. \u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u043d\u0430 \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 start, \u0430 \u0434\u0430\u043b\u0435\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f. \u0417\u0430 \u044d\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 accounting_update_query \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sql\/mysql\/dialup.conf \u041d\u043e \u0435\u0441\u043b\u0438 \u043e\u043d \u0437\u0430\u0444\u0435\u0439\u043b\u0438\u0442\u0441\u044f, freeRadius \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c accounting_update_query_alt \u0438 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e.<\/p>\n<p>  \u0412\u043e \u0432\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u0443 \u043d\u0430\u0441 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443. \u041a\u0430\u043a \u044d\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f? NAS \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e Acct-Session-Time, \u0430 \u0432\u043e\u0442 acctstarttime \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b radacct freeRadius \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u0430\u043c. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441 accounting_update_query_alt \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sql\/mysql\/dialup.conf:<\/p>\n<pre><code class=\"bash\">DATE_SUB('%S', \\                       INTERVAL (%{%{Acct-Session-Time}:-0} + \\                                 %{%{Acct-Delay-Time}:-0}) SECOND) <\/code><\/pre>\n<p>  \u0418\u0437 \u043d\u0435\u0433\u043e \u043d\u0430\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0435\u0440\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f, \u043e\u0442\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0442 \u043d\u0435\u0433\u043e Acct-Session-Time (Acct-Delay-Time \u0443 \u043d\u0430\u0441 0) \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0435\u0441\u0441\u0438\u0438.<\/p>\n<p>  \u0417\u043d\u0430\u0447\u0438\u0442 \u0432\u0435\u0441\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a: \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432 12.00.00, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0432 12.00.20 NAS \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0441\u043b\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 Interim-update, \u0438\u0437 12.00.20 \u0432\u044b\u0447\u0435\u043b 12.00.00, \u043f\u043e\u043b\u0443\u0447\u0438\u043b 20 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0430\u0442\u0440\u0438\u0431\u0443\u0442 Acct-Session-Time = 20 freeRadius&#8217;\u0443. \u041d\u0430\u0448 \u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 MySQL DATE_SUB(date,INTERVAL expr type) \u0438\u0437 12.00.20 \u0432\u044b\u0447\u0435\u043b 20, \u043f\u043e\u043b\u0443\u0447\u0438\u043b 12.00.00 \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u043b \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043a\u0430\u043a acctstarttime.<\/p>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0447\u0435\u0440\u0435\u0437 20 \u0441\u0435\u043a NAS \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u0441\u0435 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0438 \u043f\u043e\u0441\u043b\u0430\u043b Acct-Session-Time = 40 \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0430\u043a\u0435\u0442 \u043d\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0433\u0434\u0435-\u0442\u043e \u0432 \u0441\u0435\u0442\u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u0430\u043b\u0441\u044f \u0438 \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u043b \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043d\u0430 \u0447\u0430\u0441\u0430\u0445 \u0431\u044b\u043b\u043e \u0443\u0436\u0435 12.00.41, 12.00.41 \u2014 40 = 12.00.01 \u0442\u0435\u043f\u0435\u0440\u044c \u0432 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b radacct acctstarttime = 12.00.01.<\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0412\u043e\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044f \u0434\u043b\u044f \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u0430 MAX(acctstarttime) \u0433\u0434\u0435 acctstoptime = NULL \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0448\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e.<\/p>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Duration \u0432 \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u0435 \u0438 acctsessiontime \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435, \u043e\u043d\u043e \u0442\u0430\u043a \u0436\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0432\u0435\u0440\u043d\u043e. \u0412 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044e\u0437\u0435\u0440\u0430, \u043d\u043e \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445, \u043a\u043e\u0433\u0434\u0430 \u0441\u0435\u0441\u0441\u0438\u044f \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435.<\/p>\n<p>  \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0430\u043a:<\/p>\n<p>  vi \/opt\/EasyHotspot\/htdocs\/system\/application\/models\/onlineusermodel.php<\/p>\n<pre><code class=\"php\">return $this-&gt;db-&gt;query('SELECT username, MAX(radacctid), MAX(acctstarttime) as start, MAX(acctstoptime) as stop, CAST(max(acctsessiontime)\/60 AS UNSIGNED) as time,max(acctoutputoctets)+max(acctinputoctets) as packet, framedipaddress FROM radacct GROUP BY acctuniqueid HAVING stop IS NULL'); <\/code><\/pre>\n<p>  \u0412\u043e \u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u043f\u043e username, \u043f\u043e acctuniqueid. \u042d\u0442\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0441\u0435\u0441\u0441\u0438\u0438. \u0420\u0430\u0437 \u043d\u0430 MAX(acctstarttime) \u043c\u044b \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0441\u044f \u043d\u0435 \u043c\u043e\u0436\u0435\u043c, \u0431\u0443\u0434\u0435\u0442 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0441\u0435\u0441\u0441\u0438\u0438 \u0431\u0440\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 radacctid, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0441\u0443\u043c\u043c\u0443, \u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 acctsessiontime \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0441\u0435\u0441\u0441\u0438\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043c \u043d\u0430 60, \u0447\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043c\u0438\u043d\u0443\u0442\u0430\u0445 \u0438 \u0441\u043b\u043e\u0436\u0438\u043c \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0441\u0435\u0441\u0441\u0438\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f acctoutputoctets \u0438 acctinputoctets \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0437 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0439\u0434\u0435\u043c \u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0433\u0434\u0435 stop = NULL.<\/p>\n<p>  \u042d\u0442\u043e \u0438 \u0431\u0443\u0434\u0443\u0442 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u0435\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u0432\u044b\u044f\u0432\u0438\u043b\u0438 \u0440\u0430\u043d\u0435\u0435. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u043e\u043b\u043e\u043d\u043a\u0443 framedipaddress, \u043e\u043d\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0435 \u0432 \u0431\u0438\u043b\u043b\u0438\u043d\u0433.<\/p>\n<p>  vi \/opt\/EasyHotspot\/htdocs\/system\/application\/views\/onlineusers_view.php<\/p>\n<pre><code class=\"php\">&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?&gt; &lt;?php $this-&gt;load-&gt;view('header') ?&gt;  &lt;h1&gt;&lt;?=$action?&gt;&lt;\/h1&gt;   &lt;table class=&quot;stripe&quot;&gt; &lt;tbody&gt;         &lt;tr&gt;                 &lt;th&gt;&lt;?=$this-&gt;lang-&gt;line('username')?&gt;&lt;\/th&gt;                 &lt;th&gt;Start&lt;\/th&gt;                 &lt;th&gt;Duration&lt;\/th&gt;                 &lt;th&gt;Packet&lt;\/th&gt; \t\t&lt;th&gt;IP-Address&lt;\/th&gt;                   &lt;th&gt;Force Disconnect&lt;\/th&gt;         &lt;\/tr&gt;           &lt;?php foreach ($onlineusers-&gt;result() as $row): ?&gt;         &lt;tr&gt;                 &lt;td&gt;&lt;?=$row-&gt;username;?&gt;&lt;\/td&gt;                 &lt;td&gt;&lt;?=$row-&gt;start;?&gt;&lt;\/td&gt;                 &lt;td&gt;&lt;?=$row-&gt;time;?&gt;&lt;\/td&gt;                 &lt;td&gt;&lt;?=$row-&gt;packet;?&gt;&lt;\/td&gt; \t\t&lt;td&gt;&lt;?=$row-&gt;framedipaddress;?&gt;&lt;\/td&gt;                 &lt;td&gt;&lt;?=anchor('onlineuser\/disconnect\/'.$row-&gt;username,'disconnect','class=&quot;disconnect&quot; ')?&gt;&lt;\/td&gt;         &lt;\/tr&gt;         &lt;?php endforeach;?&gt; &lt;\/tbody&gt; &lt;\/table&gt;     &lt;? $this-&gt;load-&gt;view('footer'); ?&gt; <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0438 [ Cashier Menu ] -&gt; Voucher Management.<\/p>\n<p>  vi \/opt\/EasyHotspot\/htdocs\/system\/application\/models\/vouchermodel.php +22<\/p>\n<p>  \u0418\u0434\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 voucher_list \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u0430 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D1%80%D0%B5%D0%B4%D1%81%D1%82%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5_(%D0%B1%D0%B0%D0%B7%D1%8B_%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D1%85)\">\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/a>. \u0415\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \/opt\/EasyHotspot\/install\/database_with_sample.sql.<\/p>\n<pre><code class=\"sql\">VIEW `voucher_list` AS select `v`.`id` AS `id`,`v`.`username` AS `username`,`v`.`password` AS `password`,`v`.`billingplan` AS `billingplan`,`v`.`valid_until` AS `valid_until`,`b`.`type` AS `type`,`b`.`amount` AS `amount`,`b`.`valid_for` AS `valid_for`,`b`.`price` AS `price`,(sum(`ra`.`acctsessiontime`) \/ 60) AS `time_used`,if((`b`.`type` = _latin1'time'),(`b`.`amount` - (sum(`ra`.`acctsessiontime`) \/ 60)),_latin1'null') AS `time_remain`,((sum(`ra`.`acctoutputoctets`) + sum(`ra`.`acctinputoctets`)) \/ 1048576) AS `packet_used`,if((`b`.`type` = _latin1'packet'),(`b`.`amount` - (sum((`ra`.`acctoutputoctets` + `ra`.`acctinputoctets`)) \/ 1048576)),_latin1'null') AS `packet_remain`,`v`.`isexported` AS `isexported`,`v`.`isprinted` AS `isprinted`,if((`b`.`type` = _latin1'time'),if(((sum(`ra`.`acctsessiontime`) \/ 60) &gt;= `b`.`amount`),_latin1'exp',_latin1'valid'),if((((sum(`ra`.`acctoutputoctets`) + sum(`ra`.`acctinputoctets`)) \/ 1048576) &gt;= `b`.`amount`),_latin1'exp',_latin1'valid')) AS `valid` from ((`voucher` `v` left join `radacct` `ra` on((`v`.`username` = `ra`.`username`))) join `billingplan` `b` on((`b`.`name` = `v`.`billingplan`))) group by `v`.`username <\/code><\/pre>\n<p>  \u0421\u043c\u044b\u0441\u043b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446, \u043a\u0430\u043a \u043f\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u0430 \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044e, \u043a\u0430\u043a \u043a \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435. <\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"sql\">select id, username, password, billingplan, valid_until, type, amount, valid_for, price, sum(time_used) AS time_used, if((type = _latin1'time'),(amount - sum(time_used)),_latin1'null') AS time_remain, sum(packet_used) AS packet_used, if((type = _latin1'packet'),((amount - sum(packet_used)) \/ 1048576),_latin1'null') AS packet_remain, isexported, isprinted, if((type = _latin1'time'),if((sum(time_used) &gt;= amount),_latin1'exp',_latin1'valid'),if((sum(packet_used) &gt;= amount),_latin1'exp',_latin1'valid')) AS valid from (select v.id AS id,v.username AS username,v.password AS password, v.created_by AS created, v.created_time AS created_time, ra.acctuniqueid as acctuniqueid, v.billingplan AS billingplan,v.valid_until AS valid_until,b.type AS type,b.amount AS amount,b.valid_for AS valid_for,b.price AS price,(max(ra.acctsessiontime) \/ 60) AS time_used,if((b.type = _latin1'time'),(b.amount - (max(ra.acctsessiontime) \/ 60)),_latin1'null') AS time_remain,((max(ra.acctoutputoctets) + max(ra.acctinputoctets)) \/ 1048576) AS packet_used,if((b.type = _latin1'packet'),(b.amount - (max((ra.acctoutputoctets + ra.acctinputoctets)) \/ 1048576)),_latin1'null') AS packet_remain,v.isexported AS isexported,v.isprinted AS isprinted,if((b.type = _latin1'time'),if(((max(ra.acctsessiontime) \/ 60) &gt;= b.amount),_latin1'exp',_latin1'valid'),if((((max(ra.acctoutputoctets) + max(ra.acctinputoctets)) \/ 1048576) &gt;= b.amount),_latin1'exp',_latin1'valid')) AS valid from ((voucher v left join radacct ra on((v.username = ra.username))) join billingplan b on((b.name = v.billingplan))) group by v.username, ra.acctuniqueid) as b group by username <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0441\u0435\u0441\u0441\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0443\u043c\u043c\u044b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 acctsessiontime, acctoutputoctets \u0438 acctinputoctets \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0435\u0441\u0441\u0438\u044f\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>  \u041b\u043e\u0433\u0438\u043a\u0430 \u0442\u0430\u043a\u0430\u044f: \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438\u043c\u0435\u043b \u0442\u0440\u0438 \u0441\u0435\u0441\u0441\u0438\u0438 \u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 radacct \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043f\u044f\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a \u043f\u043e \u043f\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a \u043d\u0430 \u0441\u0435\u0441\u0441\u0438\u0438\u044e, \u0442\u043e \u043d\u0430\u0448 \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438. \u0410 \u043f\u043e\u0442\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0441\u0441\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u0436\u0435, \u043a\u0430\u043a \u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435.<\/p>\n<p>  \u041d\u044e\u0430\u043d\u0441 \u0437\u0434\u0435\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441. \u041d\u043e \u0437\u0430\u0442\u043e \u043e\u0434\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0443 \u0434\u0440\u0443\u0433\u043e\u0433\u043e. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 voucher_list_0 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 voucher_list:<\/p>\n<pre><code class=\"sql\">mysql -u easyhotspot -p easyhotspot_opensource Enter password: easyhotspot create VIEW voucher_list_0 AS select v.id AS id,v.username AS username,v.password AS password,ra.acctuniqueid as acctuniqueid, v.billingplan AS billingplan, v.valid_until AS valid_until,b.type AS type,b.amount AS amount,b.valid_for AS valid_for,b.price AS price,(max(ra.acctsessiontime) \/ 60) AS time_used,if((b.type = _latin1'time'),(b.amount - (max(ra.acctsessiontime) \/ 60)),_latin1'null') AS time_remain,((max(ra.acctoutputoctets) + max(ra.acctinputoctets)) \/ 1048576) AS packet_used,if((b.type = _latin1'packet'),(b.amount - (max((ra.acctoutputoctets + ra.acctinputoctets)) \/ 1048576)),_latin1'null') AS packet_remain,v.isexported AS isexported,v.isprinted AS isprinted,if((b.type = _latin1'time'),if(((max(ra.acctsessiontime) \/ 60) &gt;= b.amount),_latin1'exp',_latin1'valid'),if((((max(ra.acctoutputoctets) + max(ra.acctinputoctets)) \/ 1048576) &gt;= b.amount),_latin1'exp',_latin1'valid')) AS valid from ((voucher v left join radacct ra on((v.username = ra.username))) join billingplan b on((b.name = v.billingplan))) group by v.username, ra.acctuniqueid; <\/code><\/pre>\n<p>  \u0423\u0434\u0430\u043b\u0438\u043c \u0441\u0442\u0430\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"bash\">drop view voucher_list; <\/code><\/pre>\n<p>  \u0417\u0430\u043c\u0435\u043d\u0438\u043c \u0435\u0433\u043e \u043d\u043e\u0432\u044b\u043c:<\/p>\n<pre><code class=\"sql\">create VIEW voucher_list AS select id, username, password, billingplan, valid_until, type, amount, valid_for, price, sum(time_used) AS time_used, if((type = _latin1'time'),(amount - sum(time_used)),_latin1'null') AS time_remain, sum(packet_used) AS packet_used, if((type = _latin1'packet'),((amount - sum(packet_used)) \/ 1048576),_latin1'null') AS packet_remain, isexported, isprinted, if((type = _latin1'time'),if((sum(time_used) &gt;= amount),_latin1'exp',_latin1'valid'),if((sum(packet_used) &gt;= amount),_latin1'exp',_latin1'valid')) AS valid from voucher_list_0 group by username;  <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0438 [ Cashier Menu ] -&gt; Postpaid. \u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"sql\">VIEW `postpaid_account_list` AS select `postpaid_account`.`id` AS `id`,`postpaid_account`.`realname` AS `realname`,`postpaid_account`.`username` AS `username`,`postpaid_account`.`password` AS `password`,(sum(`radacct`.`acctsessiontime`) \/ 60) AS `time_used`,(sum((`radacct`.`acctoutputoctets` + `radacct`.`acctinputoctets`)) \/ 1048576) AS `packet_used`,`postpaid_account`.`bill_by` AS `bill_by`,(`postplan`.`price` * (sum(`radacct`.`acctsessiontime`) \/ 60)) AS `time_price`,(`postplan`.`price` * (sum((`radacct`.`acctoutputoctets` + `radacct`.`acctinputoctets`)) \/ 1048576)) AS `packet_price`,`postpaid_account`.`valid_until` AS `valid_until` from ((`postpaid_account` left join `radacct` on((`postpaid_account`.`username` = `radacct`.`username`))) join `postplan` on((`postplan`.`name` = `postpaid_account`.`bill_by`))) group by `postpaid_account`.`username`  <\/code><\/pre>\n<p>  \u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043c\u0435\u043d\u0438\u0442 `postpaid_account_list` \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"sql\">select  id, realname, username, password, sum(time_used) AS time_used, sum(packet_used) AS packet_used, bill_by, time_price, packet_price, valid_until from (select `postpaid_account`.`id` AS `id`,`postpaid_account`.`realname` AS `realname`,`postpaid_account`.`username` AS `username`,`postpaid_account`.`password` AS `password`,(max(`radacct`.`acctsessiontime`)\/60 ) AS `time_used`,(max((`radacct`.`acctoutputoctets` + `radacct`.`acctinputoctets`)) \/ 1048576) AS `packet_used`,`postpaid_account`.`bill_by` AS `bill_by`,(`postplan`.`price` * (max(`radacct`.`acctsessiontime`) \/ 60)) AS `time_price`,(`postplan`.`price` * (max((`radacct`.`acctoutputoctets` + `radacct`.`acctinputoctets`)) \/ 1048576)) AS `packet_price`,`postpaid_account`.`valid_until` AS `valid_until` from ((`postpaid_account` left join `radacct` on((`postpaid_account`.`username` = `radacct`.`username`))) join `postplan` on((`postplan`.`name` = `postpaid_account`.`bill_by`))) group by `postpaid_account`.`username`, radacct.acctuniqueid ) list group by username <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 postpaid_account_list_0 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 postpaid_account_list:<\/p>\n<pre><code class=\"sql\">create VIEW postpaid_account_list_0 AS select  `postpaid_account`.`id` AS `id`,`postpaid_account`.`realname` AS `realname`,`postpaid_account`.`username` AS `username`,`postpaid_account`.`password` AS `password`,(max(`radacct`.`acctsessiontime`)\/60 ) AS `time_used`,(max((`radacct`.`acctoutputoctets` + `radacct`.`acctinputoctets`)) \/ 1048576) AS `packet_used`,`postpaid_account`.`bill_by` AS `bill_by`,(`postplan`.`price` * (max(`radacct`.`acctsessiontime`) \/ 60)) AS `time_price`,(`postplan`.`price` * (max((`radacct`.`acctoutputoctets` + `radacct`.`acctinputoctets`)) \/ 1048576)) AS `packet_price`,`postpaid_account`.`valid_until` AS `valid_until` from ((`postpaid_account` left join `radacct` on((`postpaid_account`.`username` = `radacct`.`username`))) join `postplan` on((`postplan`.`name` = `postpaid_account`.`bill_by`))) group by `postpaid_account`.`username`, radacct.acctuniqueid; <\/code><\/pre>\n<p>  \u0423\u0434\u0430\u043b\u0438\u043c \u0441\u0442\u0430\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"bash\">drop view postpaid_account_list; <\/code><\/pre>\n<p>  \u0418 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u043e\u0435:<\/p>\n<pre><code class=\"sql\">create VIEW postpaid_account_list AS select  id, realname, username, password, sum(time_used) AS time_used, sum(packet_used) AS packet_used, bill_by, time_price, packet_price, valid_until from postpaid_account_list_0 group by username;  <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e freeRadius \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u043e\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0442\u043e\u0436\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a radacct. \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043f\u0440\u043e \u043c\u043e\u0434\u0443\u043b\u044c [noresetcounter], \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sql\/mysql\/counter.conf.<\/p>\n<p>  vi \/etc\/raddb\/sql\/mysql\/counter.conf +110<\/p>\n<pre><code class=\"bash\">sqlcounter noresetcounter { counter-name = Session-Timeout check-name = Session-Timeout reply-name = Session-Timeout sqlmod-inst = sql key = User-Name reset = never query = &quot;SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='%{${key}}'&quot; } <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0438. noresetcounter, \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0434\u0430\u043b\u0438 3600 \u0441\u0435\u043a\u0443\u043d\u0434, \u0442\u043e \u043f\u043e \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u044e \u0438\u0445 \u043e\u043d \u0443\u0436\u0435 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c\u0438 \u043a\u0440\u0435\u0434\u0435\u043d\u0446\u0438\u0430\u043b\u0430\u043c\u0438 \u043d\u0438\u043a\u043e\u0433\u0434\u0430. \u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043a\u0438\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c, \u043d\u0435\u0434\u0435\u043b\u044e, \u043c\u0435\u0441\u044f\u0446.<\/p>\n<ul>\n<li>check-name = Session-Timeout \u2014 \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e freeRadius \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 (radcheck \u0438 radgroupcheck) \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 Session-Timeout<\/li>\n<li>reply-name = Session-Timeout \u2014 \u044d\u0442\u043e\u0442 \u0436\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u044f \u0438\u0437 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e Session-Timeout \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0432\u0435\u0440\u043d\u0435\u0442 sql-\u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e.<\/li>\n<\/ul>\n<p>  \u041d\u043e \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0437\u0434\u0435\u0441\u044c query. \u042d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0447\u0438\u0441\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0436\u0435 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b. \u041b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0430\u044f \u0436\u0435, \u043a\u0430\u043a \u0438 \u043f\u0440\u0435\u0436\u0434\u0435. \u0412 \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f AcctSessionTime \u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0435\u0441\u0441\u0438\u044f\u0445 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044e\u0437\u0435\u0440\u0430, \u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0441\u043b\u043e\u0436\u0438\u043c \u0438\u0445 \u0432\u043c\u0435\u0441\u0442\u0435. \u041c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e mysql \u0444\u0443\u043d\u043a\u0446\u0438\u044e IFNULL, \u0435\u0441\u043b\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f, \u043e\u043d\u0430 \u0432\u0435\u0440\u043d\u0435\u0442 0. \u0417\u0430\u043c\u0435\u043d\u0438\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0443<\/p>\n<pre><code class=\"bash\">query = &quot;SELECT IFNULL(SUM(AcctSessionTime),0) FROM radacct WHERE UserName='%{${key}}'&quot;  <\/code><\/pre>\n<p>  \u043d\u0430 <\/p>\n<pre><code class=\"bash\">query = &quot;SELECT SUM(b) FROM (SELECT IFNULL(MAX(AcctSessionTime),0) as b FROM radacct WHERE UserName='%{${key}}'GROUP BY acctuniqueid) as list&quot; <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e, \u0430 \u0432\u0435\u0440\u043d\u0435\u0435 \u043a \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0439 \u043d\u0430\u043c \u0441\u0435\u043a\u0446\u0438\u0438 session \u0438 \u0435\u0435 \u043c\u043e\u0434\u0443\u043b\u044e [sql] \u0417\u0430\u043f\u0440\u043e\u0441 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/raddb\/sql\/mysql\/dialup.conf \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u00abSimultaneous Use Checking Queries\u00bb.<\/p>\n<pre><code class=\"bash\">simul_count_query = &quot;SELECT COUNT(*) \\                              FROM ${acct_table1} \\                              WHERE username = '%{SQL-User-Name}' \\                              AND acctstoptime IS NULL&quot; <\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0417\u0430\u043f\u0440\u043e\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 radgroupcheck \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 Simultaneous-Use := 1, \u0442\u043e \u0435\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0434\u0430\u043d\u043d\u044b\u0435 \u0435\u043c\u0443 \u043a\u0440\u0435\u0434\u0438\u043d\u0446\u0438\u0430\u043b\u044b.<\/p>\n<p>  \u0415\u0449\u0435 \u0440\u0430\u0437 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u043a\u0430\u0443\u043d\u0442\u0438\u043d\u0433\u0430 \u0434\u043b\u044f \u044e\u0437\u0435\u0440\u0430 detpis7:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/661\/f59\/efd\/661f59efda3a4285b8baaa89dc1c027f.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041a\u0430\u043a \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u043a\u0430\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432\u0435\u0440\u043d\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 simul_count_query? \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0433\u0430\u0434\u0430\u0442\u044c, \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c:<\/p>\n<pre><code class=\"bash\">mysql&gt; SELECT COUNT(*)     -&gt; FROM radacct     -&gt; WHERE username = 'detpis7'     -&gt; AND acctstoptime IS NULL; +----------+ | COUNT(*) | +----------+ |        3 | +----------+ 1 row in set (0.00 sec)  <\/code><\/pre>\n<p>  \u0425\u043e\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u0438 \u043d\u0435\u0442, \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 detpis7 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<p>  vi \/etc\/raddb\/sql\/mysql\/dialup.conf +300<\/p>\n<pre><code class=\"bash\">simul_count_query = &quot;SELECT COUNT(*) FROM (SELECT username, MAX(radacctid), MAX(acctstoptime) as stop, MAX(acctstarttime) FROM ${acct_table1} GROUP BY acctuniqueid HAVING username = '%{SQL-User-Name}' AND stop IS NULL) list&quot; <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0432 mysql:<\/p>\n<pre><code class=\"bash\">mysql&gt; SELECT COUNT(*) FROM (SELECT username, MAX(radacctid), MAX(acctstoptime) as stop, MAX(acctstarttime) FROM radacct GROUP BY acctuniqueid HAVING username = 'detpis7' AND stop IS NULL) list     -&gt; ; +----------+ | COUNT(*) | +----------+ |        0 | +----------+ 1 row in set (0.00 sec) <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c hotspot \u0441 \u0431\u0430\u0437\u043e\u0432\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u0430.       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/275155\/\"> http:\/\/habrahabr.ru\/post\/275155\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A5%D0%BE%D1%82-%D1%81%D0%BF%D0%BE%D1%82_%28Wi-Fi%29\">HotSpot<\/a>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u0437\u043d\u0443\u0442\u0440\u0438 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0443\u043f\u043e\u0440 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 freeRadius, MySQL \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u0430 Easyhotspot.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430\u0448\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043d\u0430 Cisco WLC5508 \u0438 CentOS. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u0441\u0435 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0441\u0445\u0435\u043c\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/02c\/b47\/3fb\/02cb473fb16b4f849de80e647a7588f1.jpg\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-272179","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/272179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=272179"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/272179\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=272179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=272179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=272179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}