If statement for two different sql queries
Giedrius Baronas
g.baronas at gmail.com
Sun Oct 10 23:15:00 CEST 2021
Hi,
I need help to split it radreply to two different queries.
I have a two different queries:DHCP message and ARP message
For examples
ARP query
(1) Received Access-Request Id 93 from 10.10.10.2:64387 to 10.10.10.3:1812
(1) User-Name = "d4:ca:6d:0a:94:5b"
(1) User-Password = "password"
(1) NAS-IP-Address = 10.10.10.10
(1) ADSL-Agent-Circuit-Id = "192.168.0.100"
(1) NAS-Port-Type = Ethernet
(1) NAS-Port-Id = "lag-1:1000"
DHCP query
(2) Received Access-Request Id 94 from 10.10.10.2:54337 to 10.10.10.3:1812
(2) User-Name = "d4:ca:6d:0a:94:5b"
(2) User-Password = "password"
(2) NAS-IP-Address = 10.10.10.10
(2) ADSL-Agent-Remote-Id = "5888"
(2) NAS-Port-Type = Ethernet
(2) NAS-Port-Id = "lag-1:1000"
I wrote IF statement in default file authorize section
authorize {
(...)
if(ADSL-Agent-Circuit-Id) {
if(ADSL-Agent-Circuit-Id =~ /.+\..+\..+\..+/) {
update request {
(???)
}
}else{
update request {
(???)
}
}
}
sql
I think I will use multiple instances for different rad_replay queries. Is
this a bad idea?
Is it possible to create just two queries.conf files with different queries?
--
Pagarbiai,
Giedrius
More information about the Freeradius-Users
mailing list