Compare commits
5
Commits
cf98b8dd81
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1da7648b1 | ||
|
|
da15f6ee51 | ||
|
|
b7034c733d | ||
|
|
728b99e138 | ||
|
|
8434a13338 |
@@ -237,6 +237,7 @@ simul_count_query = "\
|
|||||||
LEFT OUTER JOIN nasreload n USING (NASIPAddress) \
|
LEFT OUTER JOIN nasreload n USING (NASIPAddress) \
|
||||||
WHERE UserName='%{SQL-User-Name}' \
|
WHERE UserName='%{SQL-User-Name}' \
|
||||||
AND AcctStopTime IS NULL \
|
AND AcctStopTime IS NULL \
|
||||||
|
AND AcctSessionId != '%{Acct-Session-Id}' \
|
||||||
AND (a.AcctStartTime > n.ReloadTime OR n.ReloadTime IS NULL)"
|
AND (a.AcctStartTime > n.ReloadTime OR n.ReloadTime IS NULL)"
|
||||||
|
|
||||||
simul_verify_query = "\
|
simul_verify_query = "\
|
||||||
@@ -246,6 +247,7 @@ simul_verify_query = "\
|
|||||||
LEFT OUTER JOIN nasreload n USING (nasipaddress) \
|
LEFT OUTER JOIN nasreload n USING (nasipaddress) \
|
||||||
WHERE UserName='%{SQL-User-Name}' \
|
WHERE UserName='%{SQL-User-Name}' \
|
||||||
AND AcctStopTime IS NULL \
|
AND AcctStopTime IS NULL \
|
||||||
|
AND AcctSessionId != '%{Acct-Session-Id}' \
|
||||||
AND (a.AcctStartTime > n.reloadtime OR n.reloadtime IS NULL)"
|
AND (a.AcctStartTime > n.reloadtime OR n.reloadtime IS NULL)"
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
|
|||||||
@@ -446,15 +446,6 @@ authorize {
|
|||||||
Pool-Name := "engineers-%{sql:SELECT split_part('%{User-Name}', '@', 2)}"
|
Pool-Name := "engineers-%{sql:SELECT split_part('%{User-Name}', '@', 2)}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#
|
|
||||||
# HARD CHECK: must have IP
|
|
||||||
#
|
|
||||||
if (!&reply:Framed-IP-Address) {
|
|
||||||
update reply {
|
|
||||||
Reply-Message := "No IP assigned - access denied"
|
|
||||||
}
|
|
||||||
reject
|
|
||||||
}
|
|
||||||
# If you are using /etc/smbpasswd, and are also doing mschap authentication, the un-comment this line, and configure the 'smbpasswd' module.
|
# If you are using /etc/smbpasswd, and are also doing mschap authentication, the un-comment this line, and configure the 'smbpasswd' module.
|
||||||
# smbpasswd
|
# smbpasswd
|
||||||
|
|
||||||
@@ -657,13 +648,24 @@ accounting {
|
|||||||
# Ensure that &control:Pool-Name is set to determine which pool of IPs are used.
|
# Ensure that &control:Pool-Name is set to determine which pool of IPs are used.
|
||||||
# sqlippool
|
# sqlippool
|
||||||
|
|
||||||
### rebuild Pool-Name
|
#
|
||||||
|
# Determine the client type.
|
||||||
|
# Devices use a fixed IP from radreply.
|
||||||
|
# Engineers use an IP from sqlippool/radippool.
|
||||||
|
#
|
||||||
update control {
|
update control {
|
||||||
Pool-Name := "engineers-%{sql:SELECT split_part('%{User-Name}', '@', 2)}"
|
Tmp-String-1 := "%{sql:SELECT client_type FROM node_assignments WHERE username='%{User-Name}'}"
|
||||||
}
|
}
|
||||||
|
|
||||||
### apply only for engineers
|
#
|
||||||
if (&control:Pool-Name =~ /^engineers-/) {
|
# Return the IP to the pool only for engineers.
|
||||||
|
#
|
||||||
|
if (&control:Tmp-String-1 == "engineer") {
|
||||||
|
|
||||||
|
update control {
|
||||||
|
Pool-Name := "engineers-%{sql:SELECT split_part('%{User-Name}', '@', 2)}"
|
||||||
|
}
|
||||||
|
|
||||||
sqlippool
|
sqlippool
|
||||||
}
|
}
|
||||||
# Log traffic to an SQL database.
|
# Log traffic to an SQL database.
|
||||||
@@ -800,16 +802,37 @@ post-auth {
|
|||||||
# sqlippool
|
# sqlippool
|
||||||
|
|
||||||
# Engineers → dynamic IP
|
# Engineers → dynamic IP
|
||||||
#
|
#
|
||||||
if (&control:Pool-Name =~ /^engineers-/) {
|
if (&control:Pool-Name =~ /^engineers-/) {
|
||||||
|
|
||||||
update reply {
|
update reply {
|
||||||
Session-Timeout := 3600
|
Session-Timeout := 1200
|
||||||
|
Acct-Interim-Interval := 60
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlippool
|
sqlippool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Devices → fixed IP
|
||||||
|
# authorize --> post-auth: reuse Tmp-String-1
|
||||||
|
elsif (&control:Tmp-String-1 == "device") {
|
||||||
|
|
||||||
|
update reply {
|
||||||
|
Acct-Interim-Interval := 300
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# HARD CHECK: must have IP
|
||||||
|
#
|
||||||
|
if (!&reply:Framed-IP-Address) {
|
||||||
|
update reply {
|
||||||
|
Reply-Message := "No IP assigned - access denied"
|
||||||
|
}
|
||||||
|
reject
|
||||||
|
}
|
||||||
|
|
||||||
# Query VLAN ID from your DB
|
# Query VLAN ID from your DB
|
||||||
# VLAN assignment is no longer used
|
# VLAN assignment is no longer used
|
||||||
#vlan_test
|
#vlan_test
|
||||||
|
|||||||
Reference in New Issue
Block a user