{"id":57,"date":"2008-07-22T00:00:00","date_gmt":"2008-07-22T00:00:00","guid":{"rendered":"http:\/\/netexpertise\/en\/?p=57"},"modified":"2021-10-10T19:22:44","modified_gmt":"2021-10-10T17:22:44","slug":"ip-pools","status":"publish","type":"post","link":"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html","title":{"rendered":"Feedback on Freeradius IP Pools"},"content":{"rendered":"\n<p>If you wonder if you should use <a href=\"https:\/\/wiki.freeradius.org\/modules\/Rlm_ippool\">rlm_ippool<\/a> or <a href=\"https:\/\/wiki.freeradius.org\/modules\/Rlm_sqlippool\">rlm_sqlippool<\/a> to turn your Radius into a &#8220;DHCP&#8221; server, read on!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br>rlm_ippool<\/h2>\n\n\n\n<p>We first configured <a href=\"\/en\/category\/networking\/freeradius\">Freeradius<\/a> to provide IP addresses through the ippool module. IPs are stored internally in a binary data file.<br><br><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"\/uploads\/background-pattern-water-pool-sun-4320397.jpg\" alt=\"\"\/><figcaption><a href=\"https:\/\/pixabay.com\/users\/Mylene2401\">Mylene2401<\/a> \/ Pixabay<\/figcaption><\/figure><\/div>\n\n\n\n<p><br><strong>radiusd.conf<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">ippool main_pool {\n                range-start = 192.168.0.2\n                range-stop = 192.168.0.254\n                netmask = 255.255.255.0\n                cache-size = 800\n                session-db = ${raddbdir}\/db.ippool\n                ip-index = ${raddbdir}\/db.ipindex\n                override = yes\n                maximum-timeout = 0\n\naccounting {\n        main_pool\n}\n\npost-auth {\n        main_pool\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<br><strong>Users<\/strong><\/p>\n\n\n\n<p>In users, we&#8217;ve got:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"vim\" class=\"language-vim\">DEFAULT         Pool-Name := main_pool\n                Fall-Through = Yes<\/code><\/pre>\n\n\n\n<p>On startup, db.ippool and db.ipindex are created in the configuration directory.<\/p>\n\n\n\n<p>&nbsp;<br><strong>Test<\/strong><\/p>\n\n\n\n<p>lease-duration is set to 10 in sqlippool.conf for testing purposes. IPs should be released after 10 seconds.<br>&nbsp;<br># Let&#8217;s check the normal behaviour<br>echo &#8220;Connecting user test&#8230;&#8221;<br>echo &#8220;User-Name=\\&#8221;test\\&#8221;,User-Password=\\&#8221;test\\&#8221;,NAS-IP-Address=\\&#8221;127.0.0.1\\&#8221;,<br>NAS-Port=0&#8243; | radclient localhost:1812 auth testing123<br>echo &#8220;User-Name=\\&#8221;test\\&#8221;,Acct-Session-Id=\\&#8221;6000006B\\&#8221;,Acct-Status-Type=\\&#8221;Start\\&#8221;,<br>NAS-IP-Address=\\&#8221;127.0.0.1\\&#8221;,NAS-Port=0&#8243;| radclient localhost:1813 acct testing123<br># Checking number of IPs delivered &#8211; Should be 1<br>rlm_ippool_tool -c etc\/raddb\/db.ippool etc\/raddb\/db.ipindex<br>=&gt; 1<br>&nbsp;<br>echo &#8220;Disconnecting user test&#8221;<br>echo &#8220;User-Name=\\&#8221;test\\&#8221;,Acct-Session-Id=\\&#8221;6000006B\\&#8221;,Acct-Status-Type=\\&#8221;Stop\\&#8221;,<br>NAS-IP-Address=\\&#8221;127.0.0.1\\&#8221;,NAS-Port=0&#8243;| radclient localhost:1813 acct testing123<br># Checking number of IPs delivered &#8211; Should be 0<br>rlm_ippool_tool -c etc\/raddb\/db.ippool etc\/raddb\/db.ipindex<br>=&gt; 0 &#8211; Good!<br>&nbsp;<br># Let&#8217;s check the lease timeout<br>echo &#8220;Connecting user test&#8230;&#8221;<br>echo &#8220;User-Name=\\&#8221;test\\&#8221;,User-Password=\\&#8221;test\\&#8221;,NAS-IP-Address=\\&#8221;127.0.0.1\\&#8221;,<br>NAS-Port=0&#8243; | radclient localhost:1812 auth testing123<br>echo &#8220;User-Name=\\&#8221;test\\&#8221;,Acct-Session-Id=\\&#8221;6000006B\\&#8221;,Acct-Status-Type=\\&#8221;Start\\&#8221;,<br>NAS-IP-Address=\\&#8221;127.0.0.1\\&#8221;,NAS-Port=0&#8243;| radclient localhost:1813 acct testing123<br>rlm_ippool_tool -c etc\/raddb\/db.ippool etc\/raddb\/db.ipindex<br>=&gt; 1<br># We wait till the lease times out<br>sleep 11<br>rlm_ippool_tool -c etc\/raddb\/db.ippool etc\/raddb\/db.ipindex<br>=&gt; 1<br>The timeout isn&#8217;t working!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br>rlm_sqlippool<\/h2>\n\n\n\n<p>&nbsp;<br><strong>radiusd.conf<\/strong><\/p>\n\n\n\n<p>Upgrade first to Freeradius 1.1.7 or later and make the following changes to radiusd.conf:<br>Uncomment &#8220;$INCLUDE&nbsp;&nbsp;${confdir}\/sqlippool.conf&#8221;, remove main_pool and add sqlippool in the accounting and post-auth sections.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">accounting {\n        sqlippool\n}\n\npost-auth {\n        sqlippool\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;<br><strong>users<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"vim\" class=\"language-vim\">DEFAULT         Pool-Name := main_pool\n                Fall-Through = Yes<\/code><\/pre>\n\n\n\n<p>&nbsp;<br><strong>SQL IP Pool Creation<\/strong><\/p>\n\n\n\n<p>Add the radippool table structure in the Mysql database if necessary (included in FR):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">#\n# Table structure for table 'radippool'\n#\nCREATE TABLE radippool (\n  id                    int(11) unsigned NOT NULL auto_increment,\n  pool_name             varchar(30) NOT NULL,\n  FramedIPAddress       varchar(15) NOT NULL default '',\n  NASIPAddress          varchar(15) NOT NULL default '',\n  CalledStationId       VARCHAR(30) NOT NULL,\n  CallingStationID      VARCHAR(30) NOT NULL,\n  expiry_time           DATETIME NOT NULL default '0000-00-00 00:00:00',\n  username              varchar(64) NOT NULL default '',\n  pool_key              varchar(30) NOT NULL,\n  PRIMARY KEY (id)\n);\n<\/code><\/pre>\n\n\n\n<p>and add the file sqlippool.conf (provided in 1.1.7 and later)<br>&nbsp;<br>Add the IP pool in the base<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"sql\" class=\"language-sql\">INSERT INTO radippool (pool_name, framedipaddress) VALUES ('main_pool','192.168.0.1');\nINSERT INTO radippool (pool_name, framedipaddress) VALUES ('main_pool','192.168.0.2');\n[...]<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><br>Results<\/h2>\n\n\n\n<p>Doing the same tests with the SQL IP pool configuration gives correct results. IPs are released after 10 seconds.<\/p>\n\n\n\n<p>rlm_ippool catches more and more IPs and the pool fills up. In the end, you need to reset the pool and the customers&#8217; connections, meaning downtime!<br>&nbsp;<br>On the other hand, SQLippool is interesting if you have several Radius servers serving the same customers. IP pools are managed on the database side, which is convenient.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you wonder if you should use rlm_ippool or rlm_sqlippool to turn your Radius into a &#8220;DHCP&#8221; server, read on! rlm_ippool We first configured Freeradius to provide IP addresses through the ippool module. IPs are stored internally in a binary data file. radiusd.conf &nbsp;Users In users, we&#8217;ve got: On startup, db.ippool and db.ipindex are created [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[3],"tags":[384,386,385,10],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Netexpertise - Feedback on Freeradius IP Pools<\/title>\n<meta name=\"description\" content=\"Feedback on rlm_ippool and rlm_sqlippool modules to turn Freeradius into a DHCP server with IP pools feature\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Netexpertise - Feedback on Freeradius IP Pools\" \/>\n<meta property=\"og:description\" content=\"Feedback on rlm_ippool and rlm_sqlippool modules to turn Freeradius into a DHCP server with IP pools feature\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html\" \/>\n<meta property=\"og:site_name\" content=\"Netexpertise\" \/>\n<meta property=\"article:published_time\" content=\"2008-07-22T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-10T17:22:44+00:00\" \/>\n<meta name=\"author\" content=\"dave\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@netexpertise\" \/>\n<meta name=\"twitter:site\" content=\"@netexpertise\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html\",\"url\":\"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html\",\"name\":\"Netexpertise - Feedback on Freeradius IP Pools\",\"isPartOf\":{\"@id\":\"https:\/\/www.netexpertise.eu\/en\/#website\"},\"datePublished\":\"2008-07-22T00:00:00+00:00\",\"dateModified\":\"2021-10-10T17:22:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa\"},\"description\":\"Feedback on rlm_ippool and rlm_sqlippool modules to turn Freeradius into a DHCP server with IP pools feature\",\"breadcrumb\":{\"@id\":\"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.netexpertise.eu\/en\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Feedback on Freeradius IP Pools\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.netexpertise.eu\/en\/#website\",\"url\":\"https:\/\/www.netexpertise.eu\/en\/\",\"name\":\"Netexpertise\",\"description\":\"Systems \/ Networks \/ DevOps\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.netexpertise.eu\/en\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa\",\"name\":\"dave\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g\",\"caption\":\"dave\"},\"sameAs\":[\"http:\/\/www.netexpertise.eu\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Netexpertise - Feedback on Freeradius IP Pools","description":"Feedback on rlm_ippool and rlm_sqlippool modules to turn Freeradius into a DHCP server with IP pools feature","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html","og_locale":"en_US","og_type":"article","og_title":"Netexpertise - Feedback on Freeradius IP Pools","og_description":"Feedback on rlm_ippool and rlm_sqlippool modules to turn Freeradius into a DHCP server with IP pools feature","og_url":"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html","og_site_name":"Netexpertise","article_published_time":"2008-07-22T00:00:00+00:00","article_modified_time":"2021-10-10T17:22:44+00:00","author":"dave","twitter_card":"summary_large_image","twitter_creator":"@netexpertise","twitter_site":"@netexpertise","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html","url":"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html","name":"Netexpertise - Feedback on Freeradius IP Pools","isPartOf":{"@id":"https:\/\/www.netexpertise.eu\/en\/#website"},"datePublished":"2008-07-22T00:00:00+00:00","dateModified":"2021-10-10T17:22:44+00:00","author":{"@id":"https:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa"},"description":"Feedback on rlm_ippool and rlm_sqlippool modules to turn Freeradius into a DHCP server with IP pools feature","breadcrumb":{"@id":"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.netexpertise.eu\/en\/networking\/freeradius\/ip-pools.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.netexpertise.eu\/en"},{"@type":"ListItem","position":2,"name":"Feedback on Freeradius IP Pools"}]},{"@type":"WebSite","@id":"https:\/\/www.netexpertise.eu\/en\/#website","url":"https:\/\/www.netexpertise.eu\/en\/","name":"Netexpertise","description":"Systems \/ Networks \/ DevOps","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.netexpertise.eu\/en\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/cb4cd666549d22e9070ec1cfc1a496fa","name":"dave","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.netexpertise.eu\/en\/#\/schema\/person\/image\/","url":"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g","contentUrl":"http:\/\/1.gravatar.com\/avatar\/1129916e1f4955bd632f27f836f64e55?s=96&d=mm&r=g","caption":"dave"},"sameAs":["http:\/\/www.netexpertise.eu"]}]}},"_links":{"self":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts\/57"}],"collection":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":0,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.netexpertise.eu\/en\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}