DHCP. Several dhcp attributes from the sql table

Sergey Kodentsev sergk at ic.vrn.ru
Fri Dec 24 12:53:52 CET 2021


Hi,

On freeradius version 2.1.12 I could do the following

dhcp DHCP-Request {
............
dhcpstatic
..........

}

where dhcpstatic is the sql module

sql dhcpstaticnd {
database = "mysql"
driver = "rlm_sql _ $ {database}"
...............................

          authorize_check_query = ..........
authorize_reply_query = "SELECT id, 'dhcp' as UserName, attribute,
value, op
           FROM $ {authreply_table} dh
           WHERE RemoteID = BINARY '% {DHCP-Relay-Remote-Id}'
and upper (CircuitID) = upper ('% {DHCP-Relay-Circuit-Id}')
and MacAddr = BINARY '% {DHCP-Client-Hardware-Address}'
           ORDER BY LeaseDate desc "
...........................................
}

Several dhcp attributes were fetched from the authreply_table, not just
DHCP-Your-IP-Address

This configuration does not work on freeradius version 3.0.25

How can I select several dhcp attributes from the sql table and send
them to DHCP-ACK?

-- 
Sergey Kodentsev


More information about the Freeradius-Users mailing list