# Client's MAC address is mapped to Calling-Station-Id in policy.conf
pool_key = "%{Calling-Station-Id}"
+ # Attribute name
+ attribute_name = DHCP-Your-IP-Address
+
# For now, it works with MySQL.
$INCLUDE ${modconfdir}/sql/ippool-dhcp/mysql/queries.conf
# raddb/mods-config/sql/main/sqlite/queries.conf.
# $INCLUDE ${modconfdir}/sql/ippool-dhcp/sqlite/queries.conf
- sqlippool_log_exists = "DHCP: Existing IP: %{reply:Framed-IP-Address} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
+ sqlippool_log_exists = "DHCP: Existing IP: %{reply:${..attribute_name}} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
- sqlippool_log_success = "DHCP: Allocated IP: %{reply:Framed-IP-Address} from %{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
+ sqlippool_log_success = "DHCP: Allocated IP: %{reply:${..attribute_name}} from %{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
- sqlippool_log_clear = "DHCP: Released IP %{Framed-IP-Address} (did %{Called-Station-Id} cli %{Calling-Station-Id} user %{User-Name})"
+ sqlippool_log_clear = "DHCP: Released IP %{${..attribute_name}} (did %{Called-Station-Id} cli %{Calling-Station-Id} user %{User-Name})"
sqlippool_log_failed = "DHCP: IP Allocation FAILED from %{control:Pool-Name} (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} user %{User-Name})"
AND pool_key = '${pool_key}' \
AND username = '%{User-Name}' \
AND callingstationid = '%{Calling-Station-Id}' \
- AND framedipaddress = '%{Framed-IP-Address}'"
+ AND framedipaddress = '%{${attribute_name}}'"
#
# This series of queries frees an IP number when an accounting
AND pool_key = '${pool_key}' \
AND username = '%{User-Name}' \
AND callingstationid = '%{Calling-Station-Id}' \
- AND framedipaddress = '%{Framed-IP-Address}'"
+ AND framedipaddress = '%{${attribute_name}}'"
#
# This series of queries frees an IP number when an accounting
AND pool_key = '${pool_key}' \
AND username = '%{User-Name}' \
AND callingstationid = '%{Calling-Station-Id}' \
- AND framedipaddress = '%{Framed-IP-Address}'"
+ AND framedipaddress = '%{${attribute_name}}'"
#
# This series of queries frees the IP numbers allocate to a
WHERE nasipaddress = '%{NAS-IP-Address}' \
AND pool_name = '%{control:Pool-Name}' \
AND pool_key = '${pool_key}' \
- AND framedipaddress = '%{Framed-IP-Address}'"
+ AND framedipaddress = '%{${attribute_name}}'"
#
# This query frees an IP address when an accounting
expiry_time = CURRENT_TIMESTAMP + INTERVAL '${lease_duration}' SECOND(1) \
WHERE pool_key = '${pool_key}' \
AND pool_name = '%{control:Pool-Name}' \
- AND framedipaddress = '%{Framed-IP-Address}'"
+ AND framedipaddress = '%{${attribute_name}}'"
#
# This query frees all IP addresses allocated to a NAS when an
AND pool_key = '${pool_key}' \
AND username = '%{User-Name}' \
AND callingstationid = '%{Calling-Station-Id}' \
- AND framedipaddress = '%{Framed-IP-Address}'"
+ AND framedipaddress = '%{${attribute_name}}'"
#
# This series of queries frees an IP number when an accounting STOP record arrives
AND pool_key = '${pool_key}' \
AND username = '%{User-Name}' \
AND callingstationid = '%{Calling-Station-Id}' \
- AND framedipaddress = '%{Framed-IP-Address}'"
+ AND framedipaddress = '%{${attribute_name}}'"
#
# This series of queries frees an IP number when an accounting ALIVE record arrives
AND pool_key = '${pool_key}' \
AND username = '%{User-Name}' \
AND callingstationid = '%{Calling-Station-Id}' \
- AND framedipaddress = '%{Framed-IP-Address}'"
+ AND framedipaddress = '%{${attribute_name}}'"
#
# This series of queries frees the IP numbers allocate to a
# Call the actual module
dhcp_sqlippool
-
- # Convert Framed-IP-Address to DHCP, but only if we
- # actually allocated an address.
- if (ok) {
- update reply {
- &DHCP-Your-IP-Address = "%{reply:Framed-IP-Address}"
- }
- }
}