<span id="result_box" class="" lang="en"><span class="hps">Thanks</span> <span class="hps">Alan</span><span>.</span><br><span class="hps">I hope</span> <span class="hps">to make it work</span><span>.</span><br><br><span class="hps">As</span> <span class="hps">I have little</span> <span class="hps">experience with</span> <span class="hps">Freeradius</span>, I <span class="hps">want to start</span> <span class="hps">doing</span> <span class="hps">a little test</span> <span class="hps">with the </span><span class="hps atn">"</span><span class="">mac2ip</span><span>"</span><span> </span></span><span id="result_box" class="" lang="en"><span><span id="result_box" class="" lang="en"><span class="hps">module</span></span>.</span><br>
<br>I made <span class="hps"></span><span class="hps">a file called</span> <span class="hps"></span></span><span id="result_box" class="" lang="en"><span class="hps"><span id="result_box" class="" lang="en"><span class="hps">mac2ip in </span></span>/</span><span class="hps">etc/</span><span class="hps">freeradius</span> <span class="hps">with the following contents</span><span>:</span><br>
<br><span class="hps">00:13:96:00:f9:84,10.1.100.1</span><span class="hps"></span><br><br><span class="hps">The /</span><span class="hps">etc/</span><span class="hps">freeradius</span><span class="hps">/</span><span class="hps">sites-enabled</span><span class="hps">/</span><span class="hps">dhcp</span> <span class="hps">as follows:</span><br>
<br>server dhcp {<br> listen {<br> type = dhcp<br> ipaddr = 255.255.255.255<br> port = 67<br> interface = eth0<br> #broadcast = no<br>}<br><br>dhcp DHCP-Discover {<br> update reply {<br>
DHCP-Message-Type = DHCP-Offer<br> }<br><br> # The contents here are invented. Change them!<br> update reply {<br> DHCP-Domain-Name-Server = 8.8.8.8<br> DHCP-Domain-Name-Server += 8.8.4.4<br>
DHCP-Subnet-Mask = 255.255.0.0<br> DHCP-Router-Address = 10.1.1.3<br> DHCP-IP-Address-Lease-Time = 7200<br> DHCP-DHCP-Server-Identifier = 10.1.2.10<br> }<br><br> mac2ip<br><br> # Or, allocate IPs from the DHCP pool in SQL.<br>
#dhcp_sqlippool.postauth<br> ok<br>}<br><br>dhcp DHCP-Request {<br> update reply {<br> DHCP-Message-Type = DHCP-Ack<br> }<br><br> # The contents here are invented. Change them!<br> update reply {<br>
DHCP-Domain-Name-Server = 8.8.8.8<br> DHCP-Domain-Name-Server += 8.8.4.4<br> DHCP-Router-Address = 10.1.1.3<br> DHCP-IP-Address-Lease-Time = 7200<br> DHCP-DHCP-Server-Identifier = 10.1.2.10<br>
}<br><br> mac2ip<br><br> # Or, allocate IPs from the DHCP pool in SQL.<br> #dhcp_sqlippool.postauth<br> ok<br>}<br><br># If there's no named section for the packet type, then the packet<br># is processed through this section.<br>
dhcp {<br> # send a DHCP NAK.<br> reject<br>}<br>}<br><br>passwd mac2ip {<br> filename = ${confdir}/mac2ip<br> format = "*DHCP-Client-Hardware-Address:=DHCP-Your-IP-Address"<br> delimiter = ","<br>
}<br><br><br><span class="hps">I have added the</span> <span class="hps">dhcp</span>.<span class="hps">dictionary</span><span>.</span><br><span class="hps">At last I tried to run</span> <span class="hps">freeradius</span><span>:</span><br>
<br><br>Info: Starting - reading configuration files ...<br>Debug: including configuration file /etc/freeradius/radiusd.conf<br>Debug: including configuration file /etc/freeradius/clients.conf<br>Debug: including files in directory /etc/freeradius/mods-enabled/<br>
Debug: including configuration file /etc/freeradius/mods-enabled/rediswho<br>Debug: including configuration file /etc/freeradius/mods-enabled/replicate<br>Debug: including configuration file /etc/freeradius/mods-enabled/linelog<br>
Debug: including configuration file /etc/freeradius/mods-enabled/redis<br>Debug: including configuration file /etc/freeradius/mods-enabled/counter<br>Debug: including configuration file /etc/freeradius/mods-enabled/sradutmp<br>
Debug: including configuration file /etc/freeradius/mods-enabled/sql_log<br>Debug: including configuration file /etc/freeradius/mods-enabled/echo<br>Debug: including configuration file /etc/freeradius/mods-enabled/files<br>
Debug: including configuration file /etc/freeradius/mods-enabled/mac2vlan<br>Debug: including configuration file /etc/freeradius/mods-enabled/ntlm_auth<br>Debug: including configuration file /etc/freeradius/mods-enabled/always<br>
Debug: including configuration file /etc/freeradius/mods-enabled/soh<br>Debug: including configuration file /etc/freeradius/mods-enabled/detail.log<br>Debug: including configuration file /etc/freeradius/mods-enabled/unix<br>
Debug: including configuration file /etc/freeradius/mods-enabled/inner-eap<br>Debug: including configuration file /etc/freeradius/mods-enabled/exec<br>Debug: including configuration file /etc/freeradius/mods-enabled/krb5<br>
Debug: including configuration file /etc/freeradius/mods-enabled/smbpasswd<br>Debug: including configuration file /etc/freeradius/mods-enabled/cui<br>Debug: including configuration file /etc/freeradius/mods-enabled/expiration<br>
Debug: including configuration file /etc/freeradius/mods-enabled/perl<br>Debug: including configuration file /etc/freeradius/mods-enabled/mac2ip<br>Debug: including configuration file /etc/freeradius/mods-enabled/digest<br>
Debug: including configuration file /etc/freeradius/mods-enabled/smsotp<br>Debug: including configuration file /etc/freeradius/mods-enabled/pam<br>Debug: including configuration file /etc/freeradius/mods-enabled/wimax<br>
Debug: including configuration file /etc/freeradius/mods-enabled/mschap<br>Debug: including configuration file /etc/freeradius/mods-enabled/checkval<br>Debug: including configuration file /etc/freeradius/mods-enabled/otp<br>
Debug: including configuration file /etc/freeradius/mods-enabled/radutmp<br>Debug: including configuration file /etc/freeradius/mods-enabled/preprocess<br>Debug: including configuration file /etc/freeradius/mods-enabled/ippool<br>
Debug: including configuration file /etc/freeradius/mods-enabled/ldap<br>Debug: including configuration file /etc/freeradius/mods-enabled/logintime<br>Debug: including configuration file /etc/freeradius/mods-enabled/sqlcounter_expire_on_login<br>
Debug: including configuration file /etc/freeradius/mods-enabled/detail<br>Debug: including configuration file /etc/freeradius/mods-enabled/acct_unique<br>Debug: including configuration file /etc/freeradius/mods-enabled/passwd<br>
Debug: including configuration file /etc/freeradius/mods-enabled/chap<br>Debug: including configuration file /etc/freeradius/mods-enabled/dhcp_sqlippool<br>Debug: including configuration file /etc/freeradius/sql/mysql/ippool-dhcp.conf<br>
Debug: including configuration file /etc/freeradius/mods-enabled/realm<br>Debug: including configuration file /etc/freeradius/mods-enabled/opendirectory<br>Debug: including configuration file /etc/freeradius/mods-enabled/policy<br>
Debug: including configuration file /etc/freeradius/mods-enabled/attr_rewrite<br>Debug: including configuration file /etc/freeradius/mods-enabled/dynamic_clients<br>Debug: including configuration file /etc/freeradius/mods-enabled/attr_filter<br>
Debug: including configuration file /etc/freeradius/mods-enabled/expr<br>Debug: including configuration file /etc/freeradius/mods-enabled/etc_group<br>Debug: including configuration file /etc/freeradius/mods-enabled/cache<br>
Debug: including configuration file /etc/freeradius/mods-enabled/radrelay<br>Debug: including configuration file /etc/freeradius/mods-enabled/pap<br>Debug: including configuration file /etc/freeradius/mods-enabled/<a href="http://detail.example.com">detail.example.com</a><br>
Debug: including configuration file /etc/freeradius/eap.conf<br>Debug: including configuration file /etc/freeradius/sqlippool.conf<br>Debug: including configuration file /etc/freeradius/sql/mysql/ippool.conf<br>Debug: including configuration file /etc/freeradius/policy.conf<br>
Debug: including files in directory /etc/freeradius/sites-enabled/<br>Debug: including configuration file /etc/freeradius/sites-enabled/dhcp<br>Debug: main {<br>Debug: user = "root"<br>Debug: group = "freerad"<br>
Debug: allow_core_dumps = no<br>Debug: }<br>Debug: including dictionary file /etc/freeradius/dictionary<br>Debug: main {<br>Debug: name = "freeradius"<br>Debug: prefix = "/usr"<br>Debug: localstatedir = "/var"<br>
Debug: sbindir = "/usr/sbin"<br>Debug: logdir = "/var/log/freeradius"<br>Debug: run_dir = "/var/run/freeradius"<br>Debug: libdir = "/usr/lib/freeradius"<br>Debug: radacctdir = "/var/log/freeradius/radacct"<br>
Debug: hostname_lookups = no<br>Debug: max_request_time = 30<br>Debug: cleanup_delay = 5<br>Debug: max_requests = 1024<br>Debug: pidfile = "/var/run/freeradius/freeradius.pid"<br>Debug: checkrad = "/usr/sbin/checkrad"<br>
Debug: debug_level = 0<br>Debug: proxy_requests = yes<br>Debug: log {<br>Debug: stripped_names = no<br>Debug: auth = no<br>Debug: auth_badpass = no<br>Debug: auth_goodpass = no<br>Debug: }<br>Debug: security {<br>
Debug: max_attributes = 200<br>Debug: reject_delay = 1<br>Debug: status_server = yes<br>Debug: }<br>Debug: }<br>Debug: radiusd: #### Loading Realms and Home Servers ####<br>Debug: radiusd: #### Loading Clients ####<br>
Debug: client localhost {<br>Debug: ipaddr = 127.0.0.1<br>Debug: require_message_authenticator = no<br>Debug: secret = "testing123"<br>Debug: nastype = "other"<br>Debug: }<br>Debug: radiusd: #### Instantiating modules ####<br>
Debug: instantiate {<br>Debug: (Loaded rlm_exec, checking if it's valid)<br>Debug: Module: Linked to module rlm_exec<br>Debug: Module: Instantiating module "exec" from file /etc/freeradius/mods-enabled/exec<br>
Debug: exec {<br>Debug: wait = no<br>Debug: input_pairs = "request"<br>Debug: shell_escape = yes<br>Debug: }<br>Debug: (Loaded rlm_expr, checking if it's valid)<br>Debug: Module: Linked to module rlm_expr<br>
Debug: Module: Instantiating module "expr" from file /etc/freeradius/mods-enabled/expr<br>Debug: (Loaded rlm_expiration, checking if it's valid)<br>Debug: Module: Linked to module rlm_expiration<br>Debug: Module: Instantiating module "expiration" from file /etc/freeradius/mods-enabled/expiration<br>
Debug: expiration {<br>Debug: reply-message = "Password Has Expired "<br>Debug: }<br>Debug: (Loaded rlm_logintime, checking if it's valid)<br>Debug: Module: Linked to module rlm_logintime<br>Debug: Module: Instantiating module "logintime" from file /etc/freeradius/mods-enabled/logintime<br>
Debug: logintime {<br>Debug: reply-message = "You are calling outside your allowed timespan "<br>Debug: minimum-timeout = 60<br>Debug: }<br>Debug: }<br>Debug: radiusd: #### Loading Virtual Servers ####<br>
Debug: server { # from file /etc/freeradius/radiusd.conf<br>Debug: modules {<br>Debug: } # modules<br>Debug: } # server<br>Debug: server dhcp { # from file /etc/freeradius/sites-enabled/dhcp<br>Debug: modules {<br>Debug: Module: Checking dhcp DHCP-Discover {...} for more modules to load<br>
Debug: (Loaded rlm_passwd, checking if it's valid)<br>Debug: Module: Linked to module rlm_passwd<br>Debug: Module: Instantiating module "mac2ip" from file /etc/freeradius/mods-enabled/mac2ip<br>Debug: passwd mac2ip {<br>
Debug: filename = "/etc/freeradius/mac2ip"<br>Debug: format = "*DHCP-Client-Hardware-Address:=DHCP-Your-IP-Address"<br>Debug: delimiter = ","<br>Debug: ignorenislike = yes<br>
Debug: ignoreempty = yes<br>Debug: allowmultiplekeys = no<br>Debug: hashsize = 100<br>Debug: }<br>Debug: rlm_passwd: nfields: 2 keyfield 0(DHCP-Client-Hardware-Address) listable: no<br>Debug: (Loaded rlm_always, checking if it's valid)<br>
Debug: Module: Linked to module rlm_always<br>Debug: Module: Instantiating module "ok" from file /etc/freeradius/mods-enabled/always<br>Debug: always ok {<br>Debug: rcode = "ok"<br>Debug: simulcount = 0<br>
Debug: mpp = no<br>Debug: }<br>Debug: Module: Checking dhcp DHCP-Request {...} for more modules to load<br>Debug: Module: Checking dhcp (null) {...} for more modules to load<br>Error: /etc/freeradius/sites-enabled/dhcp[153]: No name specified for Post-Auth-Type block<br>
Debug: } # modules<br>Debug: } # server<br>Debug: radiusd: #### Opening IP addresses and Ports ####<br>Debug: listen {<br>Debug: type = "auth"<br>Debug: ipaddr = *<br>Debug: port = 0<br>Debug: }<br>
Debug: listen {<br>Debug: type = "acct"<br>Debug: ipaddr = *<br>Debug: port = 0<br>Debug: }<br>Debug: listen {<br>Debug: type = "dhcp"<br>Debug: ipaddr = 255.255.255.255<br>Debug: port = 67<br>
Debug: }<br>Debug: Listening on authentication address * port 1812<br>Debug: Listening on accounting address * port 1813<br>Debug: Listening on dhcp interface eth0 address 255.255.255.255 port 67 as server dhcp<br>Debug: Listening on proxy address * port 1814<br>
Info: Ready to process requests.<br><br><br><br>Received DHCP-Discover of id 8e22cb4d from <a href="http://0.0.0.0:68">0.0.0.0:68</a> to <a href="http://255.255.255.255:67">255.255.255.255:67</a><br>01 01 06 00 8e 22 cb 4d 00 00 80 00 00 00 00 00 <br>
00 00 00 00 00 00 00 00 00 00 00 00 00 13 96 00 <br>f9 84 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 63 82 53 63 <br>35 01 01 3d 08 01 00 13 96 00 f9 84 00 33 04 ff <br>
ff ff 00 33 04 ff ff ff ff 37 0b 01 03 06 0f 12 <br>42 78 87 d5 d6 d7 ff 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <br>00 00 00 00 <br> DHCP-Opcode = Client-Message<br> DHCP-Hardware-Type = Ethernet<br>
DHCP-Hardware-Address-Length = 6<br> DHCP-Hop-Count = 0<br> DHCP-Transaction-Id = 2384644941<br> DHCP-Number-of-Seconds = 0<br> DHCP-Flags = Broadcast<br> DHCP-Client-IP-Address = 0.0.0.0<br> DHCP-Your-IP-Address = 0.0.0.0<br>
DHCP-Server-IP-Address = 0.0.0.0<br> DHCP-Gateway-IP-Address = 0.0.0.0<br> DHCP-Client-Hardware-Address = 00:13:96:00:f9:84<br> DHCP-Message-Type = DHCP-Discover<br> DHCP-Client-Identifier = 0x0100139600f98400<br>
DHCP-IP-Address-Lease-Time = 4294967040<br> DHCP-IP-Address-Lease-Time = 4294967295<br> DHCP-Parameter-Request-List = DHCP-Subnet-Mask<br> DHCP-Parameter-Request-List = DHCP-Router-Address<br> DHCP-Parameter-Request-List = DHCP-Domain-Name-Server<br>
DHCP-Parameter-Request-List = DHCP-Domain-Name<br> DHCP-Parameter-Request-List = DHCP-Bootp-Extensions-Path<br> DHCP-Parameter-Request-List = DHCP-TFTP-Server-Name<br> DHCP-Parameter-Request-List = DHCP-SIP-Servers-DHCP-Option<br>
DHCP-Parameter-Request-List = DHCP-HTTP-Proxy<br> DHCP-Parameter-Request-List = 213<br> DHCP-Parameter-Request-List = 214<br> DHCP-Parameter-Request-List = 215<br>Info: server dhcp {<br>Debug: Trying sub-section dhcp DHCP-Discover {...}<br>
Info: +- entering group DHCP-Discover {...}<br>Info: ++[reply] returns noop<br>Info: ++[reply] returns noop<br>Segmentation fault<br><br><br><span class="hps">I'm</span> <span class="hps">missing something</span> <span class="hps">obvious</span><span>?</span><br>
<span class="hps">Thanks</span> <span class="hps">in advance.</span></span>