<AuthBy HOTSPOT> provides advanced support
for hotspot functionality, including differentiated services and
prepaid/postpaid quotas. It combines
<ServiceDatabase>,
<SessionDatabase>, an authenticating
<AuthBy xxxxxx> to a working solution which can
be used with captive portals (for example MikroTik) and network access
controllers supporting RADIUS. Besides hotspot use-case,
<AuthBy HOTSPOT> can also be used to implement
quota control for fixed-line access or cellular APN. It can also utilise
<AuthBy DYNAUTH> (RADIUS Dynamic Authorization)
for sending CoA/DM, for example, after a successful authentication or when
a quota has been depleted.goodies/hotspot.cfg and
goodies/README.hotspot for a sample configuration
file. For a derived AuthBy, see Section 3.83. <AuthBy HOTSPOTFIDELIO>.<AuthBy HOTSPOT> understands also the same
parameters as <AuthBy xxxxxx>. For more
information, see Section 3.32. <AuthBy xxxxxx>.# Lookup a subscription based on username (%1) and Calling-Station-Id MAC address
SubscriptionId %1-%{Calling-Station-Id}
# Lookup a session based on username, Class and Calling-Station-Id MAC address
SessionId %1-%3-%{Calling-Station-Id}
# Our hotspot is configured this send this attribute in RADIUS requests ServiceAttribute OSC-AVPAIR
# Access-Request from our captive portal has multiple instances # of ServiceAttribute, use the ones with this prefix ServiceAttributePrefix Mikrotik-Service=
SessionId parameter is used to detect
sessions. Defaults to Acct-Session-Id.# Set this to an empty value SessionAttribute
default.# Name of default service defined in our ServiceDatabase DefaultService free
name:default price:0.# Make this empty for no default configured service DefaultServiceDefinition
Access-Reject message with
Reply-Message attribute is used to ask for a
confirmation of the upgrade or renewal charge. Disabled by
default.# Use Access-Reject with Reply-Message for confirmation ConfirmSubscription
ConfirmSubscription flag parameter is set. Defaults
to: You are going to upgrade or renew your plan, please login
again to confirm the charge.# Change the default to more specific ConfirmationMessage Please log in again to approve Wi-Fi charge at checkout.
# If RADIUS accounting will be used for quota monitoring, # create a new session upon a successful authentication PreProvisionSession
# Authenticate Hotspot users with AuthBy that has this identifier AuthBy AuthBy-FILE
# Use ServiceDatabase with this identifier for services and subscriptions ServiceDatabase ServiceDatabase-INTERNAL
# Use SessionDatabase with this identifier for sessions SessionDatabase SessionDatabase-INTERNAL
PoolHint.# Use non-default IPv4 pool attribute name to return service pool name PoolIPv4Attribute Framed-Pool
PoolHint6.# Use non-default IPv6 pool attribute name to return service pool name PoolIPv6Attribute Framed-IPv6-Pool
# Use accounting and return to NAS remaining time quota with Session-Timeout # and data quota with Mikrotik attributes. UsageMonitoring ReplyWithDataQuota DataLimitAttribute Mikrotik-Total-Limit DataLimitGigawordsAttribute Mikrotik-Total-Limit-Gigawords
# Enable BW control for pre-paid, post-paid and throttled (quota exceeded) cases ReplyWithBandwidthControl UploadRateAttribute WISPr-Bandwidth-Max-Up DownloadRateAttribute WISPr-Bandwidth-Max-Down
OSC-Upload-Rate. See Section 3.81.22. ReplyWithBandwidthControl
for an example.OSC-Download-Rate. See Section 3.81.22. ReplyWithBandwidthControl
for an example.OSC-Data-Limit. See Section 3.81.21. UsageMonitoring
for an example.OSC-Data-Limit-Gigawords.
See Section 3.81.21. UsageMonitoring
for an example.ChargeHook
must return new username, a charging reference and new price. Charging
reference can be undefined. If username is undefined, charging is not done
and request is rejected.ChargeHook has the
following arguments:ChargeHook:# Charge mikem with double rate
ChargeHook sub {my $name = $_[1]; my $price = $_[3]; \
return ($name, undef, $price*2);}
Access-Accept
reply.ReplyAdjustHook return value is ignored.
However, it is passed references to current request and reply for
modification.ReplyAdjustHook has the following
arguments:ReplyAdjustHook:# Reply debugging for radpwtst testing
ReplyAdjustHook sub {my $rp = $_[1]; my $time_left = $_[2]; \
$rp->add_attr('OSC-AVPAIR', "time-debug=$time_left"); }
# Allocate only 10% SessionQuotaSupplyFraction 10
# Experiment with 90% threshold SessionQuotaResupplyThreshold 90
# Change resupply time to 20 minutes. 1200 would work also as the value. SessionQuotaResupplyTimeMin 20m
# Change resupply data to 20 000 000 octets. Can use 20M or 20000000 as the value. SessionQuotaResupplyDataMin 20M