<AuthBy RADSEC>
proxies RADIUS
requests to a <ServerRADSEC>
clause on remote
Radiator using the RadSec (RFC 6614) secure reliable RADIUS proxying
protocol. It can be used instead of <AuthBy
RADIUS>
when proxying across insecure or unreliable networks
such as the internet. For more information about the RadSec protocol, see
Section 16. RadSec (RFC 6614).<AuthBy
RADSEC>
attempts to establish a RadSec connection to the
server Hosts when Radiator start up. If the connection subsequently fails
or is disconnected, it will attempt to reestablish the connection at
ReconnectTimeout
intervals.<AuthBy RADSEC>
can be
configured for multiple target hosts by specifying multiple Host clauses
inside the <AuthBy RADSEC>
clause. Normally
when a packet is to forwarded, <AuthBy RADSEC>
attempts first to send it to the first Host. If no reply is received from
that Host
within NoreplyTimeout
seconds, it attempts to send the request to the next Host and so on. If no
reply is heard from any Host
, the
NoReplyHook
is called.<AuthBy
RADSEC>
supports TLS. For more information about TLS
parameters, see Section 3.11. TLS configuration.<AuthBy
RADSEC>
implements a configurable algorithm to detect failed
RadSec hosts, and to temporarily disregard failed hosts. The algorithm
uses the MaxFailedRequests
,
MaxFailedGraceTime
, and
FailureBackoffTime
parameters to customise the
operation of the algorithm. For more information, see Section 3.42.15. MaxFailedRequests, Section 3.42.16. MaxFailedGraceTime, and Section 3.42.14. FailureBackoffTime. It also uses
KeepaliveTimeout
and
UseStatusServerForFailureDetect
in order to use only
Status-Server requests for failure detection, instead of any request. For
more information, see Section 3.42.9. KeepaliveTimeout and Section 3.42.13. UseStatusServerForFailureDetect.<AuthBy
RADSEC>
initially assumes that each Host is not failed.
After a request is sent to a RadSec server, if no reply is received after
the NoreplyTimeout, that request is deemed to have failed for that Host.
<AuthBy RADSEC>
keeps track of how many
consecutive requests failed for each Host since the last time a reply was
heard from that Host. If more than MaxFailedRequests
consecutive requests are deemed to have failed within
MaxFailedGraceTime
seconds of that last reply heard
from that Host
, that Host
is
deemed to have failed.Host
is deemed
to be failed, <AuthBy RADSEC>
does not attempt
to send any requests to it until FailureBackoffTime
seconds have elapsed. In the meantime, <AuthBy
RADSEC>
attempts to connect or reconnect to the host
according to ReconnectTimeout
. It also skips sending
requests to that Host
, and instead attempts to send
to the next Host
in its list of
Host
s (if any).MaxFailedRequests 1 MaxFailedGraceTime 0 FailureBackoffTime 0
<AuthBy RADSEC>
declares the Host failed after
a single packet transmission failure, but that it always tries to transmit
the next request to the Host. This means that <AuthBy
RADSEC>
always tries to send every request to the first
Host
, and if nothing is heard from that
Host
within NoreplyTimeout
, it
attempts to send to the next Host
.Host
fails to respond to requests, then it will automatically temporarily fall
back to the next RadSec Host
and so
on.<AuthBy
RADSEC>
Client, the Client performs a number of checks to
validate the server certificate. The server certificate is checked for
valid start and end dates, and it also checks the chain of validity back
to the issuing Certificate Authority, using the root certificates
specified in TLS_CAFile
or
TLS_CAPath
. If TLS_PolicyOID
parameter is defined, the OIDs must be present in the certificate path.
Also a server certificate is accepted only if at least one of the
following conditions are true:Host
name used to connect to the server
matches a subjectAltName with type IPADD (IP Address) or DNS (DNS
name) in the certificate. Exact or wild card matches are permitted, so
a subjectAltName type DNS of ‘*.xyz.com’ matches for any Host in
xyz.com.TLS_ExpectedPeerName
parameter in this
<AuthBy RADSEC>
clause.TLS_SubjectAltNameURI
parameter is defined
in the <AuthBy RADSEC>
clause, the
certificate must contain a subjectAltName of type URI that matches the
TLS_SubjectAltNameURI
regular expression.TLS_CertificateFingerprint
parameter is
defined in the <AuthBy RADSEC>
clause, the
certificate's fingerprint must match at least one of the
TLS_CertificateFingerprint
options.TLS_ExpectedPeerName
pattern is undefined, which means that by default <AuthBy
RADSEC>
requires that the Host
name
used to connect to the RadSec server matches the subjectAltName or CN in
the Server Certificate.<AuthBy RADSEC>
clause completes as soon as the
request has been forwarded to the remote RadSec server. It does not wait
for a reply before moving on to other AuthBy clauses, or handling new
requests. <AuthBy RADSEC>
always returns IGNORE
for AuthByPolicy
.<AuthBy RADSEC>
is to connect to. The address
can be an IPv4 or IPv6 name or address. Multiple Host lines are supported,
which is equivalent to specifying multiple
<Host>
clauses. Special formatting characters
are supported.Host
:# Example Host lines for IPv4 and IPv6 addresses Host 203.63.154.1 Host oscar.open.com.au Host ipv6:your.ipv6.host.com Host 2001:db8:1500:1::a100 # IPv6 loopback: Host ::1
<ServerRADSEC>
this clause connects to. The
Secret is used to protect passwords even when TLS is not configured for
use. If TLS is used, it is not necessary to change it from the default,
since the security of TLS does not depend on the shared secret. For
compliance with RFC 6614, the default value is radsec
.
There usually is no need to change this.2083
, the official IANA port number for RadSec. Special
formatting characters are supported.LocalPort
is a string, it can be a port
number or name. It binds the local port if
LocalAddress
is defined. If
LocalPort
is not specified or if it is set to
0
, a port number is allocated in the usual
way.LocalAddress
must be either IPv4 or IPv6
addresses.LocalAddress 203.63.154.29 LocalPort 12345
NoReplyHook
is called for this request. The default value is 5 seconds.0
seconds and
keepalives are not used. When
UseStatusServerForFailureDetect
is enabled,
KeepaliveTimeout
together with
MaxFailedRequests
defines the minimum time it takes
to notice the next hop has failed.KeepaliveNoreplyTimeout
defines, the
Status-Server request is marked as lost.KeepaliveNoreplyTimeout
is not defined, the waiting
time value depends on the AuthBy you are using:<AuthBy RADCSEC>
:
NoreplyTimeout
value is used instead.<AuthBy RADIUS>
:
RetryTimeout
value is used instead.KeepaliveNoreplyTimeout
and a larger value for
NoreplyTimeout
or RetryTimeout
.
The Status-Server responder is always the next hop host and a reply is
received quickly. With a short
KeepaliveNoreplyTimeout
, a possible failure situation
is discovered quickly and the request is rerouted to another server. The
final destination of an Access-Request or an Accounting-Request message
may be located many hops away and for this reason a long
NoreplyTimeout
may be needed.KeepaliveNoreplyTimeout
and
NoreplyTimeout
in <AuthBy
RADSEC>
: <AuthBy RADSEC> NoreplyTimeout 10 KeepaliveNoreplyTimeout 3 </AuthBy>
<AuthBy RADIUS>
, you must use
RetryTimeout
instead of
NoreplyTimeout
.KeepaliveRequestType
with
AddToKeepaliveRequest
:
# Send Access-Request as keepalive probe KeepaliveRequestType Access-Request AddToKeepaliveRequest User-Name=mikem,User-Password=fred
AddToKeepaliveRequest
with
KeepaliveRequestType
:
# Send Access-Request as keepalive probe KeepaliveRequestType Access-Request AddToKeepaliveRequest User-Name=mikem,User-Password=fred
NoreplyTimeout
,
MaxFailedRequests
,
MaxFailedGraceTime
,
FailureBackoffTime
during failure detection.KeepaliveTimeout
is set
to a sensible interval to balance between detecting failures early and
loading the target server.# Remove any NAS-IP-Address,NAS-Port attributes StripFromRequest NAS-IP-Address,NAS-Port
StripFromRequest
removes attributes from the request before AddToRequest adds any to the
request. You can use any of the special % formats in the attribute values.
There is no default.# Append a Filter-ID and host name AddToRequest Calling-Station-Id=1,Login-IP-Host=%h
AddToRequest
, an attribute will only be added
if it does not already exist in the request. Value is a list of comma
separated attribute value pairs. You can use any of the special % formats
in the attribute values. There is no default.# Possibly add our default Operator-Name AddToRequestIfNotExist Operator-Name=1example.com
# If we get a reject from the remote, do not send it to the NAS IgnoreReject
<AuthBy
RADSEC>
to ignore replies to accounting requests, instead of
forwarding them back to the originating host. This can be used in
conjunction with the AccountingHandled
flag in a
Handler or Realm to ensure that every proxied accounting request is
replied to immediately, and the eventual reply from the remote RADSEC
server is dropped. For more information about AccountingHandled flag, see
Section 3.31.6. AccountingHandled.Acct-Status-Type
attribute values that will be processed
in Accounting requests. The value is a comma-separated list of valid
Acct-Status-Type
attribute values including,
Start
, Stop
, Alive
,
Modem-Start
, Modem-Stop
,
Cancel
, Accounting-On
and
Accounting-Off
. See your dictionary for a full
list.HandleAcctStatusTypes
is specified and
an Accounting request has an Acct-Status-Type
not
mentioned in HandleAcctStatusTypes
, then the request
will be ACCEPTed but not otherwise processed by the enclosing clause. The
default is to handle all Acct-Status-Type
values.# Only process Start and Stop requests, ACCEPT and acknowledge everything else HandleAcctStatusTypes Start,Stop
AcctFailedLogFileName
is defined, failed accounting
messages are not logged. The default is no logging. The file name can
include special formatting characters as described in Section 3.3. Special formatters, which means that,
for example, using the %c specifier, you can maintain separate accounting
log files for each Client. The AcctFailedLogFileName
file is always opened, written and closed for each failure, so you can
safely rotate it at any time.RewriteUsername
is enabled.AcctLogFileFormat
.# Log all accounting to a single log file in LogDir AcctFailedLogFileName %L/misseddetails
AcctLogFileFormatHook
is not defined.
AcctLogFileFormat
is a string containing special
formatting characters. It specifies the format for each line to be printed
to the accounting log file. A new line is automatically appended. It is
most useful if you use the %{attribute}
style of
formatting characters (to print the value of the attributes in the current
packet.AcctLogFileFormat %{Timestamp} %{Acct-Session-Id}\ %{User-Name}
AcctLogFileFormat
or the default format is used. The
hook parameter is the reference to the current request.# Change RadiusResult in the 3rd argument, the original request ReplyHook sub { ${$_[2]}->{RadiusResult} = $main::ACCEPT; }
ReplyHook
Can be an arbitrarily
complicated Perl function, that might run external processes, consult
databases, change the contents of the current request or many other
things.# Fake a new attribute into the reply going back to the client ReplyHook sub { ${$_[1]}->add_attr('test-attr', \ 'test-value');}
NoReplyHook
can be an arbitrarily
complicated Perl function, that might run external processes, consult
databases, change the contents of the current request or many other
things. In particular, you can forward the request to another AuthBy
RADSEC clause, allowing you to implement automatic failover of RadSec
hosts.# Call another AuthBy RADSEC if this one fails to respond NoReplyHook sub { Radius::AuthGeneric::find('RADSEC2')\ ->handle_request(${$_[0]}, ${$_[2]});}
<AuthBy RADSEC>
to return with
result REJECT to trigger an Access-Reject when a proxied request times
out. This parameter is not set by default.NoReplyReject
is enabled, the reject reason is set to
'Upstream timeout'.NoReplyReject
allows rejecting timed out requests without hooks such as
NoReplyHook
. For more information, see Section 3.71.21. NoReplyHook<AuthBy
RADSEC>
is to return IGNORE as soon as the request has been
forwarded to the remote RadSec server. It does not wait for a reply before
moving on to other AuthBy classes or handling new requests. You can change
this behaviour with the Asynchronous
flag.Asynchronous
flag,
Handler
continues to evaluate its AuthBy policy after
a reply or timeout from the remote proxy. Other requests are processed
while the reply is pending.<AuthBy RADSEC>
, see
Section 3.71. <AuthBy RADSEC>. Asynchronous
:# Auth to server1 and continue to AuthBy FILE if server 1 accepts. # Process other requests while the reply from server 1 is pending. <Handler> AuthByPolicy ContinueWhileAccept <AuthBy RADSEC> # Evaluate the policy when we get a reply or a timeout Asynchronous Host server1 # Other parameters </AuthBy> <AuthBy FILE> Filename %D/users </AuthBy> </Handler>
ForwardHook
receives the following
arguments:ForwardHook
:
ForwardHook sub { my $p = $_[0]; my $fp = $_[1]; \ $fp->add_attr('OSC-AVPAIR', 'Added by ForwardHook'); }
<AuthBy
RADSEC>
forwarding Authentication-Requests. They are
ACCEPTED, but no further action is taken with them. This is different in
meaning to IgnoreAuthentication
, which IGNOREs
them.# Just ACCEPT Authentication-Requests, do not forward them NoForwardAuthentication
<AuthBy
RADSEC>
forwarding Accounting-Requests. They are ACCEPTED,
but no further action is taken with them. This is different in meaning to
IgnoreAccounting
, which IGNOREs them.# Just ACCEPT Accounting-Requests, do not forward them NoForwardAccounting
# Strip everything except username and password AllowInRequest User-Name,User-Password
0
. When connections are known to be short-lived, a
non-default value may be useful. This parameter is available for all
Stream based modules, such as <ServerDIAMETER>
and <AuthBy RADSEC>
.# Debug logging is enough for peer disconnects DisconnectTraceLevel 4
<AuthBy RADSEC>
does not attempt to send
any requests after host is deemed to be failed. During that time,
<AuthBy RADSEC>
attempts to connect to another
host according to host configuration and to send the requests to the next
host in the list of hosts, if there is any. tcp
for TCP/IP or
sctp
for SCTP (Stream Control Transmission Protocol). The
default value is tcp
. Not all hosts are able to support
sctp
, consult your vendor. The protocol setting must be
the same in each RadSec server and client.Protocol sctp
modprobe sctp
Gossip
flag parameter enables this
AuthBy to send and listen for notifications (aka. gossip) to/from other
Radiator servers when any remote Radius server fails to reply. This is
disabled by default.goodies/farmsize.cfg
for a
configuration sample.# Use the configured Gossip implementation for notifications Gossip
GossipNoReply
flag parameter is
set, then a notification is sent when a remote Radius server fails to
reply. Radiator server also increases a counter for failed requests when a
notification is received. This is enabled by default.GossipHostDown
flag parameter is
set, then a notification is sent when a remote Radius server is marked
down. Radiator server also marks the remote Radius server down when a
notification is received. This is enabled by default.GossipHostUp
flag parameter is
set, then a notification will be send when a remote Radius server is
marked up and alive again. Radiator server also marks the remote Radius
server healthy when a notification is received. This is enabled by
default.NoreplyTimeout
seconds,
Radiator logs a fail-over and attempts to connect the next listed
host.ProxyAlgorithm
. Currently, it supports the following
values:FailOver
EAPBalance
HashBalance
LoadBalance
VolumeBalance
RoundRobin
ProxyAlgorithm
is not set by default, which
means that FailOver
method is used. Format specifiers,
such as %{GlobalVar:name}
, are evaluated when the
configuration is loaded.HashBalance
proxy algorithm uses
HashAttributes
configuration parameter to specify
which attributes in the incoming request are used to select the target
host. The default value is
%{Request:Calling-Station-Id}:%n
.HashAttributes
:HashAttributes %{Request:NAS-IP-Address}