<pre><font size="4">Hello all.<br>I tried to configure freeradius to operate as dhcp server.<br>I have one problem. Freeradius receives DHCP-Discover and DHCP-Request packets, <br>but replies are not sent. In logs all OK, but strace output contains error </font><font><font><font><font><font><font><font><font size="4">EINVAL (Invalid argument)</font></font></font></font></font></font></font></font><font size="4"> in packet sending via sendmsg.<br>
<br><br>Freeradius version is 2.1.x from git.<br><br>My config file:<br><br>dhcp:===========================<br><br></font>listen { <br> ipaddr = *<br> port = 67<br> type = dhcp<br> interface = eth0<br>
broadcast = yes<br>}<br><br>dhcp DHCP-Discover {<br> linelog<br> update reply {<br> DHCP-Message-Type = DHCP-Offer<br> DHCP-Domain-Name-Server = 192.168.194.169<br> DHCP-Domain-Name-Server = 192.168.192.53<br>
DHCP-Subnet-Mask = 255.255.255.128<br> DHCP-Router-Address = 192.168.194.126<br> DHCP-IP-Address-Lease-Time = 86400<br> DHCP-DHCP-Server-Identifier = 192.168.194.105<br>
DHCP-Your-IP-Address = 192.168.194.106<br> }<br> linelog<br> ok<br>}<br><br>dhcp DHCP-Request {<br> update reply {<br> DHCP-Message-Type = DHCP-Ack<br> }<br>
update reply {<br> DHCP-Domain-Name-Server = 192.168.194.169<br> DHCP-Domain-Name-Server = 192.168.192.53<br> DHCP-Subnet-Mask = 255.255.255.128<br> DHCP-Router-Address = 192.168.194.126<br>
DHCP-IP-Address-Lease-Time = 86400<br> DHCP-DHCP-Server-Identifier = 192.168.194.105<br> DHCP-Your-IP-Address = 192.168.194.106<br> }<br> ok<br>} <br><br><font><font size="4">dhcp:===========================<br>
<br>Log fragment:<br><br>freeradius -X ==================<br><font size="2">Received DHCP-Discover of id f1b3e779 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>
DHCP-Opcode = Client-Message<br> DHCP-Hardware-Type = Ethernet<br> DHCP-Hardware-Address-Length = 6<br> DHCP-Hop-Count = 0<br> DHCP-Transaction-Id = 4055099257<br> DHCP-Number-of-Seconds = 31<br> DHCP-Flags = 0<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:22:15:30:16:7b<br> DHCP-Message-Type = DHCP-Discover<br> DHCP-Requested-IP-Address = 192.168.194.106<br>
DHCP-Hostname = "capt-eee"<br> DHCP-Parameter-Request-List = DHCP-Subnet-Mask<br> DHCP-Parameter-Request-List = DHCP-Broadcast-Address<br> DHCP-Parameter-Request-List = DHCP-Time-Offset<br> DHCP-Parameter-Request-List = DHCP-Router-Address<br>
DHCP-Parameter-Request-List = DHCP-Domain-Name<br> DHCP-Parameter-Request-List = DHCP-Domain-Name-Server<br> DHCP-Parameter-Request-List = DHCP-Domain-Search<br> DHCP-Parameter-Request-List = DHCP-Hostname<br> DHCP-Parameter-Request-List = DHCP-NETBIOS-Name-Servers<br>
DHCP-Parameter-Request-List = DHCP-NETBIOS<br> DHCP-Parameter-Request-List = DHCP-Interface-MTU-Size<br> DHCP-Parameter-Request-List = DHCP-Classless-Static-Route<br> DHCP-Parameter-Request-List = DHCP-NTP-Servers<br>server dhcp {<br>
Trying sub-section dhcp DHCP-Discover {...}<br>+- entering group DHCP-Discover {...}<br>[linelog] expand: %{reply:DHCP-Message-Type} -> <br>[linelog] ... expanding second conditional<br>[linelog] expand: %{request:DHCP-Message-Type} -> DHCP-Discover<br>
[linelog] expand: %{%{reply:DHCP-Message-Type}:-%{request:DHCP-Message-Type}} -> DHCP-Discover<br>[linelog] expand: /var/log/radius/linelog -> /var/log/radius/linelog<br>[linelog] expand: %{DHCP-Transaction-Id} DISCOVER: [%{DHCP-Client-Hardware-Address}] via (%{DHCP-Gateway-IP-Address}) %{DHCP-Hostname} -> 4055099257 DISCOVER: [00:22:15:30:16:7b] via (0.0.0.0) capt-eee<br>
++[linelog] returns ok<br>++[reply] returns ok<br>[linelog] expand: %{reply:DHCP-Message-Type} -> DHCP-Offer<br>[linelog] expand: %{%{reply:DHCP-Message-Type}:-%{request:DHCP-Message-Type}} -> DHCP-Offer<br>[linelog] expand: /var/log/radius/linelog -> /var/log/radius/linelog<br>
[linelog] expand: %{DHCP-Transaction-Id} OFFER: %{reply:DHCP-Your-IP-Address} to [%{DHCP-Client-Hardware-Address}] ... -> 4055099257 OFFER: 192.168.194.106 to [00:22:15:30:16:7b] ...<br>++[linelog] returns ok<br>++[ok] returns ok<br>
} # server dhcp<br>Sending DHCP-Offer of id f1b3e779 from <a href="http://0.0.0.0:67">0.0.0.0:67</a> to <a href="http://255.255.255.255:68">255.255.255.255:68</a><br> DHCP-Subnet-Mask = 255.255.255.128<br> DHCP-Router-Address = 192.168.194.126<br>
DHCP-Domain-Name-Server = 192.168.194.169<br> DHCP-IP-Address-Lease-Time = 86400<br> DHCP-DHCP-Server-Identifier = 192.168.194.105<br>Finished request 5.<br>Cleaning up request 5 ID -239868039 with timestamp +85<br>Going to the next request<br>
Ready to process requests.<br></font></font></font><font><font><font><font size="4">freeradius -X ==================</font></font></font></font><br><br><font><font><font><font size="4"></font></font></font></font><font><font><font><font size="4">STRACE output =================<br>
write(1, "Ready to process requests.\n", 27) = 27<br>select(20, [11 13 14 15 16 17 18 19], NULL, NULL, NULL) = 1 (in [17])<br>getsockname(17, {sa_family=AF_INET, sin_port=htons(67), sin_addr=inet_addr("0.0.0.0")}, [16]) = 0<br>
recvmsg(17, {msg_name(16)={sa_family=AF_INET, sin_port=htons(68), sin_addr=inet_addr("0.0.0.0")}, msg_iov(1)=[{"\1\1\6\0\361\263\347y\0\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\"\0250"..., 1460}], msg_controllen=32, {cmsg_len=28, cmsg_level=SOL_IP, cmsg_type=, ...}, msg_flags=0}, 0) = 300<br>
write(1, "Received DHCP-Discover of id f1b"..., 76) = 76<br>write(1, "\tDHCP-Opcode = Client-Message\n", 30) = 30<br>write(1, "\tDHCP-Hardware-Type = Ethernet\n", 31) = 31<br>write(1, "\tDHCP-Hardware-Address-Length = "..., 34) = 34<br>
write(1, "\tDHCP-Hop-Count = 0\n", 20) = 20<br>write(1, "\tDHCP-Transaction-Id = 405509925"..., 34) = 34<br>write(1, "\tDHCP-Number-of-Seconds = 31\n", 29) = 29<br>write(1, "\tDHCP-Flags = 0\n", 16) = 16<br>
write(1, "\tDHCP-Client-IP-Address = 0.0.0."..., 34) = 34<br>write(1, "\tDHCP-Your-IP-Address = 0.0.0.0\n", 32) = 32<br>write(1, "\tDHCP-Server-IP-Address = 0.0.0."..., 34) = 34<br>write(1, "\tDHCP-Gateway-IP-Address = 0.0.0"..., 35) = 35<br>
write(1, "\tDHCP-Client-Hardware-Address = "..., 50) = 50<br>write(1, "\tDHCP-Message-Type = DHCP-Discov"..., 35) = 35<br>write(1, "\tDHCP-Requested-IP-Address = 80."..., 43) = 43<br>write(1, "\tDHCP-Hostname = \"capt-eee\"\n", 28) = 28<br>
write(1, "\tDHCP-Parameter-Request-List = D"..., 48) = 48<br>write(1, "\tDHCP-Parameter-Request-List = D"..., 54) = 54<br>write(1, "\tDHCP-Parameter-Request-List = D"..., 48) = 48<br>write(1, "\tDHCP-Parameter-Request-List = D"..., 51) = 51<br>
write(1, "\tDHCP-Parameter-Request-List = D"..., 48) = 48<br>write(1, "\tDHCP-Parameter-Request-List = D"..., 55) = 55<br>write(1, "\tDHCP-Parameter-Request-List = D"..., 50) = 50<br>write(1, "\tDHCP-Parameter-Request-List = D"..., 45) = 45<br>
write(1, "\tDHCP-Parameter-Request-List = D"..., 57) = 57<br>write(1, "\tDHCP-Parameter-Request-List = D"..., 44) = 44<br>write(1, "\tDHCP-Parameter-Request-List = D"..., 55) = 55<br>write(1, "\tDHCP-Parameter-Request-List = D"..., 59) = 59<br>
write(1, "\tDHCP-Parameter-Request-List = D"..., 48) = 48<br>write(1, "server dhcp {\n", 14) = 14<br>write(1, "Trying sub-section dhcp DHCP-Dis"..., 44) = 44<br>write(1, "+- entering group DHCP-Discover "..., 38) = 38<br>
write(1, "[linelog] \texpand: %{reply:DHCP-"..., 50) = 50<br>write(1, "[linelog] \t... expanding second "..., 44) = 44<br>write(1, "[linelog] \texpand: %{request:DHC"..., 65) = 65<br>write(1, "[linelog] \texpand: %{%{reply:DHC"..., 96) = 96<br>
write(1, "[linelog] \texpand: /var/log/radi"..., 70) = 70<br>open("/var/log/radius/linelog", O_WRONLY|O_CREAT|O_APPEND, 0600) = 20<br>write(1, "[linelog] \texpand: %{DHCP-Transa"..., 203) = 203<br>
write(20, "4055099257 DISCOVER: [00:22:15:3"..., 64) = 64<br>close(20) = 0<br>write(1, "++[linelog] returns ok\n", 23) = 23<br>write(1, "++[reply] returns ok\n", 21) = 21<br>
write(1, "[linelog] \texpand: %{reply:DHCP-"..., 60) = 60<br>write(1, "[linelog] \texpand: %{%{reply:DHC"..., 93) = 93<br>write(1, "[linelog] \texpand: /var/log/radi"..., 70) = 70<br>open("/var/log/radius/linelog", O_WRONLY|O_CREAT|O_APPEND, 0600) = 20<br>
write(1, "[linelog] \texpand: %{DHCP-Transa"..., 182) = 182<br>write(20, "4055099257 OFFER: 80.91.194.106 "..., 59) = 59<br>close(20) = 0<br>write(1, "++[linelog] returns ok\n", 23) = 23<br>
write(1, "++[ok] returns ok\n", 18) = 18<br>write(1, "} # server dhcp\n", 16) = 16<br>write(1, "Sending DHCP-Offer of id f1b3e77"..., 72) = 72<br>write(1, "\tDHCP-Subnet-Mask = 255.255.255."..., 36) = 36<br>
write(1, "\tDHCP-Router-Address = 80.91.194"..., 37) = 37<br>write(1, "\tDHCP-Domain-Name-Server = 80.91"..., 41) = 41<br>write(1, "\tDHCP-IP-Address-Lease-Time = 86"..., 36) = 36<br>write(1, "\tDHCP-DHCP-Server-Identifier = 8"..., 45) = 45<br>
sendmsg(17, {msg_name(16)={sa_family=AF_INET, sin_port=htons(68), sin_addr=inet_addr("255.255.255.255")}, msg_iov(1)=[{"\2\1\6\0\361\263\347y\0\0\0\0\0\0\0\0P[\302jP[\302i\0\0\0\0\0\"\0250"..., 300}], msg_controllen=32, {cmsg_len=28, cmsg_level=SOL_IP, cmsg_type=, ...}, msg_flags=0}, 0) = -1 EINVAL (Invalid argument)<br>
write(1, "Finished request 5.\n", 20) = 20<br>write(1, "Cleaning up request 5 ID -239868"..., 55) = 55<br>write(1, "Going to the next request\n", 26) = 26<br>wait4(-1, NULL, 0, NULL) = -1 ECHILD (No child processes)<br>
write(1, "Ready to process requests.\n", 27) = 27<br><br></font></font></font></font><font><font><font><font><font><font><font><font size="4">STRACE output =================</font></font></font></font></font></font></font></font><br>
<br></pre>