help with DHCP server functionality
List: Hello. I have been working on this for a few days and have turned here for help. The server is listening on port 67 and when a DHCP packet comes in the server processes it, but in debug mode it give an error "No Pool-Name defined". I have done some reading and I have added the following to the users file (for testing purposes). DEFAULT Pool-Name := main_pool Fall-Through = Yes This doesn't seem to define the Pool-Name nor do I see where the server is processing any sql queries to determine the Pool-Name either. Am I mistaken? I thought that I could get a DHCP packet to be received/processed by the server and hand out a response. Thanks in advance, Duane Cox debug: Received DHCP-Discover of id 9daef956 from 10.11.156.70:68 to 10.12.100.90:67 DHCP-Opcode = Client-Message DHCP-Hardware-Type = Ethernet DHCP-Hardware-Address-Length = 6 DHCP-Hop-Count = 1 DHCP-Transaction-Id = 2645490006 DHCP-Number-of-Seconds = 56 DHCP-Flags = 0 DHCP-Client-IP-Address = 0.0.0.0 DHCP-Your-IP-Address = 0.0.0.0 DHCP-Server-IP-Address = 0.0.0.0 DHCP-Gateway-IP-Address = 10.11.152.62 DHCP-Client-Hardware-Address = 00:d0:b7:c0:f6:8a DHCP-Message-Type = DHCP-Discover DHCP-Parameter-Request-List = DHCP-Subnet-Mask DHCP-Parameter-Request-List = DHCP-Broadcast-Address DHCP-Parameter-Request-List = DHCP-Time-Offset DHCP-Parameter-Request-List = DHCP-Router-Address DHCP-Parameter-Request-List = DHCP-Domain-Name DHCP-Parameter-Request-List = DHCP-Domain-Name-Server DHCP-Parameter-Request-List = DHCP-Hostname server dhcp { Trying sub-section dhcp DHCP-Discover {...} +- entering group DHCP-Discover {...} ++[reply] returns noop ++[reply] returns noop [mac2ip] Added DHCP-Your-IP-Address: '10.11.152.1' to reply_items ++[mac2ip] returns ok ++- entering policy dhcp_sqlippool.post-auth {...} expand: DHCP-%{DHCP-Client-Hardware-Address} -> DHCP-00:d0:b7:c0:f6:8a expand: %{DHCP-Client-Hardware-Address} -> 00:d0:b7:c0:f6:8a expand: %{DHCP-Gateway-IP-Address} -> 10.11.152.62 expand: %{%{DHCP-Gateway-IP-Address}:-127.0.0.1} -> 10.11.152.62 +++[request] returns ok [dhcp_sqlippool] No Pool-Name defined. [dhcp_sqlippool] expand: DHCP: No Pool-Name defined (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name}) -> DHCP: No Pool-Name defined (did cli 00:d0:b7:c0:f6:8a port user DHCP-00:d0:b7:c0:f6:8a) DHCP: No Pool-Name defined (did cli 00:d0:b7:c0:f6:8a port user DHCP-00:d0:b7:c0:f6:8a) +++[dhcp_sqlippool] returns noop +++? if (ok) ? Evaluating (ok) -> FALSE +++? if (ok) -> FALSE ++- policy dhcp_sqlippool.post-auth returns noop ++[ok] returns ok } # server dhcp DHCP-Subnet-Mask = 255.255.255.192 DHCP-Router-Address = 10.11.152.62 DHCP-Domain-Name-Server = 4.2.2.1 DHCP-IP-Address-Lease-Time = 86400 DHCP-DHCP-Server-Identifier = 10.12.100.90 Sending DHCP-Offer of id 9daef956 to 10.11.152.62:68 Finished request 6. Cleaning up request 6 ID -1649477290 with timestamp +219 Going to the next request Ready to process requests.
On Fri, Nov 2, 2012 at 3:19 AM, Duane Cox <duanecox@gmail.com> wrote:
List:
Hello. I have been working on this for a few days and have turned here for help.
The server is listening on port 67 and when a DHCP packet comes in the server processes it, but in debug mode it give an error "No Pool-Name defined".
I have done some reading and I have added the following to the users file (for testing purposes).
DEFAULT Pool-Name := main_pool Fall-Through = Yes
This doesn't seem to define the Pool-Name nor do I see where the server is processing any sql queries to determine the Pool-Name either.
Am I mistaken? I thought that I could get a DHCP packet to be received/processed by the server and hand out a response.
My policy.conf has this: #============ # Assign compatibility data to request for sqlippool dhcp_sqlippool.post-auth { # Do some minor hacks to the request so that it looks # like a RADIUS request to the SQL IP Pool module. update control { Pool-Name = "DHCP-default" } update request { .... #============ ... and my sites-available/dhcp has additional instructions: #============ # * Create sqlippool table, if you haven't done so already. # * Import the schema (see sql/mysql/ipool.sql). # * Populate the records. At minimum each row must have # Framed-IP-Address and Pool-Name = 'DHCP-default' (or whatever # you set 'Pool-Name' to on policy.conf). # * If you want to use static IP allocation, create a row on # radippol table with 'callingstationid' set to client's MAC # address (e.g. '00:16:3E:02:15:6B') and expiry time far in the # future (e.g. '3000-01-01 00:00:00'). #============ Try updating your policy.conf and follow that instruction. If that works for you, I'll probably send a git pull request to update instructions in the included config files. -- Fajar
OK, that solved my dilemma of no Pool-Name defined, thanks! What are other operators doing to determine the appropriate pool? Should there be some unlang in policy.conf to update the control to the appropriate name? Or perhaps an SQL function? Thanks, Duane -----Original Message----- From: freeradius-users-bounces+duanecox=gmail.com@lists.freeradius.org [mailto:freeradius-users-bounces+duanecox=gmail.com@lists.freeradius.org ] On Behalf Of Fajar A. Nugraha Sent: Thursday, November 01, 2012 4:58 PM To: FreeRadius users mailing list Subject: Re: help with DHCP server functionality On Fri, Nov 2, 2012 at 3:19 AM, Duane Cox <duanecox@gmail.com> wrote:
List:
Hello. I have been working on this for a few days and have turned here for help.
The server is listening on port 67 and when a DHCP packet comes in the
server processes it, but in debug mode it give an error "No Pool-Name defined".
I have done some reading and I have added the following to the users file (for testing purposes).
DEFAULT Pool-Name := main_pool Fall-Through = Yes
This doesn't seem to define the Pool-Name nor do I see where the server is processing any sql queries to determine the Pool-Name either.
Am I mistaken? I thought that I could get a DHCP packet to be received/processed by the server and hand out a response.
My policy.conf has this: #============ # Assign compatibility data to request for sqlippool dhcp_sqlippool.post-auth { # Do some minor hacks to the request so that it looks # like a RADIUS request to the SQL IP Pool module. update control { Pool-Name = "DHCP-default" } update request { .... #============ ... and my sites-available/dhcp has additional instructions: #============ # * Create sqlippool table, if you haven't done so already. # * Import the schema (see sql/mysql/ipool.sql). # * Populate the records. At minimum each row must have # Framed-IP-Address and Pool-Name = 'DHCP-default' (or whatever # you set 'Pool-Name' to on policy.conf). # * If you want to use static IP allocation, create a row on # radippol table with 'callingstationid' set to client's MAC # address (e.g. '00:16:3E:02:15:6B') and expiry time far in the # future (e.g. '3000-01-01 00:00:00'). #============ Try updating your policy.conf and follow that instruction. If that works for you, I'll probably send a git pull request to update instructions in the included config files. -- Fajar - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Fri, Nov 2, 2012 at 6:30 AM, Duane Cox <duanecox@gmail.com> wrote:
OK, that solved my dilemma of no Pool-Name defined, thanks!
Hmmm ... this just arrived in my mailbox. Anyway, in case you still need the response ...
What are other operators doing to determine the appropriate pool?
What do you mean?
Should there be some unlang in policy.conf to update the control to the appropriate name?
Yes. There's an "update control" block on policy.conf. This is assuming you only have one DHCP pool. You could, in theory, define multiple pools for dhcp by editing policy.conf and other dhcp-related files accordingly. The logic is pretty much straight forward. It's just not tested yet.
Or perhaps an SQL function?
Nope.
Thanks, Duane
-- Fajar
Thanks Fajar, that did help me get past this hurdle. Pressing forward with the dhcp side... Thanks, Duane Sent from my iPad by Verizon Wireless On Nov 1, 2012, at 4:59 PM, "Fajar A. Nugraha" <list@fajar.net> wrote:
On Fri, Nov 2, 2012 at 3:19 AM, Duane Cox <duanecox@gmail.com> wrote:
List:
Hello. I have been working on this for a few days and have turned here for help.
The server is listening on port 67 and when a DHCP packet comes in the server processes it, but in debug mode it give an error "No Pool-Name defined".
I have done some reading and I have added the following to the users file (for testing purposes).
DEFAULT Pool-Name := main_pool Fall-Through = Yes
This doesn't seem to define the Pool-Name nor do I see where the server is processing any sql queries to determine the Pool-Name either.
Am I mistaken? I thought that I could get a DHCP packet to be received/processed by the server and hand out a response.
My policy.conf has this:
#============ # Assign compatibility data to request for sqlippool dhcp_sqlippool.post-auth {
# Do some minor hacks to the request so that it looks # like a RADIUS request to the SQL IP Pool module. update control { Pool-Name = "DHCP-default" } update request { .... #============
... and my sites-available/dhcp has additional instructions: #============ # * Create sqlippool table, if you haven't done so already. # * Import the schema (see sql/mysql/ipool.sql). # * Populate the records. At minimum each row must have # Framed-IP-Address and Pool-Name = 'DHCP-default' (or whatever # you set 'Pool-Name' to on policy.conf). # * If you want to use static IP allocation, create a row on # radippol table with 'callingstationid' set to client's MAC # address (e.g. '00:16:3E:02:15:6B') and expiry time far in the # future (e.g. '3000-01-01 00:00:00'). #============
Try updating your policy.conf and follow that instruction.
If that works for you, I'll probably send a git pull request to update instructions in the included config files.
-- Fajar - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (2)
-
Duane Cox -
Fajar A. Nugraha