Appendix G. Supported RADIUS Attribute/Value Pairs for L2TP operation

RADIUS is used for authentication and accounting of L2TP connections. If no authentication servers are configured then authentication is not performed. If no accounting servers are configured then no accounting is generated. Multiple servers can be configured and they are processed in order. Each can have multiple IP addresses. The IP addresses are tried based on the previous performance (response time, etc). If a server does not respond a number of times as configured then it is blacklisted for a configurable period.

It is possible to configure local configurations which are checked before any RADIUS authentication.

It is possible to configure L2TP so that RADIUS accounting must respond, and if not then the sessions are disconnected.

G.1. Authentication

Table G.1. Access-request

AVPNo.Usage
Message-Authenticator80Message signature as per RFC2869
User-Name1Username from authentication (PAP/CHAP) or proxy authentication received on L2TP
Called-Station-Id30Called number as received on L2TP
Calling-Station-Id31Calling number as received on L2TP
Acct-Session-Id44Unique ID (hex string) for session as used on all following accounting records
NAS-Identifier32Configured hostname of FireBrick
NAS-IP-Address4NAS IPv4 address if using IPv4
NAS-IPv6-Address95NAS IPv6 address if using IPv6
NAS-Port5L2TP session ID
Service-Type6Framed
Framed-Protocol7PPP
CHAP-Password3CHAP ID and response
CHAP-Challenge60CHAP challenge (only present if not the same as RADIUS authenticator)
Framed-MTU12MTU requested by PPP, if one was requested (even if 1500)
Connect-Info77Text Tx speed/Rx speed from L2TP connection if known
Tunnel-Client-Endpoint66Indicates the L2TP tunnel configured name attribute, allowing connections via different L2TP incoming configurations to be identified

Note that the NAS-IP-Address is normally the local end of the L2TP connection for the incoming connection. However, there is a configuration option to pass the remote end of the L2TP as the NAS-IP-Address as this is often more useful. If the remote Ip is used the NAS-Port is set to the far end L2TP session ID rather than the local end session ID. The NAS-Identified remains the name of the FB6000. This option is separately available for accounting messages.

Note that the Calling-Station-Id is included even if not present in L2TP connection if a cache platform RADIUS request matched the L2TP connection and had a Calling-Station-Id.

G.2. Authentication response

G.2.1. Accepted authentication

Table G.2. Access-Accept

AVPNo.Usage
Reply-Message18Reply message sent on PPP authentication response
MS-Primary-DNS-Address311/28Primary DNS address used in PPP IPCP (Vendor 311 specific)
MS-Secondary-DNS-Address311/29Secondary DNS address used in PPP IPCP (Vendor 311 specific)
Framed-Interface-ID96Peer IPv6 Interface ID expected in PPP IPV6CP
Framed-IP-Address8Peer IPv4 address expected in PPP IPCP (does not support 255.255.255.255 or 255.255.255.254 yet). Maximum localpref used.
NAS-IP-Address4Our end IPv4 address to in IPCP negotiation. Does not add loopback route. This is non standard.
Framed-Route22May appear more than once. Text format is IPv4-Address/Bits 0.0.0.0 metric. The target IP is ignored but must be valid IPv4 syntax. The metric is used as localpref in routing.
Delegated-IPv6-Prefix123IPv6 prefix to be routed to line. Maximum localpref used.
Framed-IPv6-Prefix97IPv6 prefix to be routed to line. Maximum localpref used.
Framed-IPv6-Route99May appear more than once. Text format is IPv6-Address/Bits :: metric. The target IP is ignored but must be valid IPv6 syntax. The metric is used as localpref in routing. Alternative format IPv6/Bits IPv4-Address metric defines that prefix is to be protocol 41 IPv4 tunneled to specified target via this link.
User-Name1Username may be specified - this replaces the username already present and is then used on accounting start and relay L2TP.
CHAP-Password3CHAP-Password may be specified - this replaces the CHAP ID and response that is then sent on to a tunnel.
Called-Station-Id30Called number may be specified - this replaces the number already present and is then used on the accounting start and relay L2TP
Calling-Station-Id31Calling number may be specified - this replaces the number already present and is then used on the accounting start and relay L2TP
Chargeable-User-Identity89This is used as the preferred CQM graph name.
Class25Secondary CQM graph name to group sessions allowing group logging or shaping.
Session-Timeout27Absolute limit on session, in seconds
Filter-Id11See filter ID section
Framed-MTU12Set MTU for session
Connect-Info77Text tx speed limit to apply to session
Tunnel-Type64If specified must be 3 (L2TP), L2TP is assumed
Tunnel-Medium-Type65If specified must be 1 (IPv4) or 2 (IPv6), syntax of endpoint is used if this is not specified
Tunnel-Server-Endpoint67Text IPv4 or IPv6 address of endpoint (FQDN is not accepted)
Tunnel-Client-Auth-ID90Hostname to quote on outgoing tunnel, if omitted then configured FireBrick hostname is used
Tunnel-Password69Shared secret to use on outgoing tunnel (encrypted), if omitted then assumed no secret
Tunnel-Assignment-ID81Name of outgoing tunnel shaper/graph. Also groups sessions together in a tunnel as per RFC. Only use valid text graph names.
Tunnel-Preference83Specifies preference order when multiple tagged endpoints sent

Note that whilst a RADIUS response is normally relatively small in can get larger when multiple tunnel endpoints are included. Fragmented responses are handled but there is an internal limit to the size of response that can be processed - as such we recommend keeping the response to a single un-fragmented packet of up to 1500 bytes. You can use tag 0 for common settings such as Tunnel-Client-Auth-ID or Tunnel-Password when using multiple endpoints in order to reduce the size of the response.

G.2.2. Prefix Delegation

The RADIUS authentication response can include Delegated-IPv6-Prefix, Framed-IPv6-Prefix, and Framed-IPv6-Route in order to route native IPv6 prefixes to the line. If there are any native IPv6 routes, or the Framed-IPv6-Interface attribute was specified, then IPV6CP negotiation is started. Framed-IPv6-Route can also be used to added IPv4 tunneled routes to the line. The FE80::/10 link local address negotiated with IPV6CP is not added to the routing for the line.

The client can send a Router solicitation to which the FireBrick will reply advising to use DHCPv6 for addressing. Once a router solicitation is sent, periodic Router Advertisements will then be sent on the connection by the Firebrick.

The client can use DHCPv6 to request an IA_NA (/128 link address), IA_TA (/128 temp link address), IA_PD (Prefic delegation) and DNS servers. Prefixes are delegated based on the order in the DHCPv6 request and the order of Delegated-IPv6-Prefix, Framed-IPv6-Prefix, and then Framed-IPv6-Route, with multiple such entries in the order that they appeared in the RADIUS response. Such prefixes are not split up if a smaller prefix is requested, but the first part of a prefix is delegated.

G.2.3. Rejected authentication

Table G.3. Access-Reject

AVPNo.Usage
Reply-Message18Reply message sent on PPP authentication response

Note that an authentication reject will normally cause the reply message to be sent as an authentication reject message. The reply "Try another" causes the L2TP session to be closed with result/error 2/7 (Try another) without sending an authentication reply on PPP.

G.3. Accounting Start

Table G.4. Accounting-Start

AVPNo.Usage
Acct-Status-Type401 Start
User-Name1Username from authentication (PAP/CHAP) or proxy authentication received on L2TP or received in authentication response
Class25From authentication response if present
Chargeable-User-Identity89Graph name that applies, sanitised to comply with CQM graph name rules..
Called-Station-Id30Called number as received on L2TP
Calling-Station-Id31Calling number as received on L2TP
Service-Type6Framed
Framed-Protocol7PPP
Framed-MTU12Final MTU being used for session
Filter-Id11Filters in use
Session-Timeout27Absolute limit on session, in seconds, if specified in authentication reply
Framed-Interface-ID96Peer IPv6 Interface ID from PPP IPV6CP
Framed-IP-Address8Peer IPv4 address negotiated in PPP (normally from authentication response)
Connect-Info77Text Tx speed/Rx speed in use
Acct-Delay-Time41Seconds since session started
Acct-Event-Timestamp55Session start time (unix timestamp)
Acct-Session-Id44Unique ID (hex string) for session
NAS-Identifier32Configured hostname of FireBrick
NAS-IP-Address4NAS IPv4 address if using IPv4
NAS-IPv6-Address95NAS IPv6 address if using IPv6
NAS-Port5L2TP session ID
Tunnel-Type64Present for relayed L2TP sessions, L2TP
Tunnel-Medium-Type65Present for relayed L2TP, 1 (IPv4) or 2 (IPv6)
Tunnel-Client-Endpoint66Present for relayed L2TP, text IPv4 or IPv6 address of our address on the outbound tunnel
Tunnel-Server-Endpoint67Present for relayed L2TP, text IPv4 or IPv6 address of the far end address of the outbound tunnel
Tunnel-Assignment-ID82Present for relayed L2TP, text local L2TP tunnel ID
Tunnel-Client-Auth-ID90Present for relayed L2TP, local end hostname quoted by outgoing tunnel
Tunnel-Server-Auth-ID91Present for relayed L2TP, far end hostname quoted by outgoing tunnel

Note that most parameters are not included in interim and stop accounting records. The acct-session-id should be used by accounting servers to correlate interim and stop records with the start record. The graph name could be used, but is only available where there is a graph. If too many different graphs then that is not present. Some exceptions apply as they can be changed by a change of authorisation RADIUS request, such as Connect-Info.

G.4. Accounting Interim

Table G.5. Accounting-Interim

AVPNo.Usage
Acct-Status-Type403 Interim-Update
Acct-Delay-Time41Seconds since accounting data collected
Acct-Event-Timestamp55Data collected time (unix timestamp)
Acct-Session-Id44Unique ID (hex string) for session
Chargeable-User-Identity89Graph name that applies, sanitised to comply with CQM graph name rules..
Connect-Info77Text Tx speed/Rx speed in use
NAS-Identifier32Configured hostname of FireBrick
NAS-IP-Address4NAS IPv4 address if using IPv4
NAS-IPv6-Address95NAS IPv6 address if using IPv6
NAS-Port5L2TP session ID
Acct-Input-Octets42Rx byte count
Acct-Input-Gigawords52Rx byte count (high 4 bytes)
Acct-Output-Octets43Tx byte count
Acct-Output-Gigawords53Tx byte count (high 4 bytes)
Acct-Input-Packets47Rx packet count
Acct-Output-Packets48Tx packet count
Tunnel-Type64Present for relayed L2TP sessions, L2TP
Tunnel-Medium-Type65Present for relayed L2TP, 1 (IPv4) or 2 (IPv6)
Tunnel-Client-Endpoint66Present for relayed L2TP, text IPv4 or IPv6 address of our address on the outbound tunnel
Tunnel-Server-Endpoint67Present for relayed L2TP, text IPv4 or IPv6 address of the far end address of the outbound tunnel
Tunnel-Assignment-ID82Present for relayed L2TP, text local L2TP tunnel ID
Tunnel-Client-Auth-ID90Present for relayed L2TP, local end hostname quoted by outgoing tunnel
Tunnel-Server-Auth-ID91Present for relayed L2TP, far end hostname quoted by outgoing tunnel

G.5. Accounting Stop

As accounting interim update plus

Table G.6. Accounting-Stop

AVPNo.Usage
Acct-Terminate-Cause49Cause code as appropriate

Cause codes of note are 2(Lost-Carrier) which is sent if LCP echos do not reply for several seconds, and 14(Port-Suspended) which is sent if the dos-limit is exceeded on a session. For DOS handling is is recommended that subsequent authentication requests are rejected for several minutes or a fake accept is and session-timeout is used as DOS attacks usually continue until the customer is off-line.

G.6. Disconnect

A disconnect message is accepted as per RFC5176, if the session can be disconnected, and ACK is sent, else a NAK

Table G.7. Disconnect

AVPNo.Usage
Acct-Session-Id44Unique ID (hex string) for session
Chargeable-User-Identity89This is used as CQM graph name.
Acct-Terminate-Cause49Cause code as appropriate to be used in accounting stop message

The session is identified by Acct-Session-Id if present, else by Chargeable-User-Identity. No other identification parameters are supported. If sent then they are ignored.

G.7. Change of Authorisation

A change of authorisation message is accepted as per RFC5176

Table G.8. Change-of-Authorisation

AVPNo.Usage
Acct-Session-Id44Unique ID (hex string) for session
Chargeable-User-Identity89This is used as CQM graph name.
Framed-Route22May appear more than once. Text format is IPv4-Address/Bits 0.0.0.0 metric. The target IP is ignored but must be valid IPv4 syntax. The metric is used as localpref in routing.
Delegated-IPv6-Prefix123IPv6 prefix to be routed to line. Maximum localpref used.
Framed-IPv6-Prefix97IPv6 prefix to be routed to line. Maximum locapref used.
Framed-IPv6-Route99May appear more than once. Text format is IPv6-Address/Bits :: metric. The target IP is ignored but must be valid IPv6 syntax. The metric is used as localpref in routing. Alternative format IPv6/Bits IPv4-Address metric defines that prefix is to be protocol 41 IPv4 tunneled to specified target via this link.
Session-Timeout27Absolute limit on session, in seconds
Terminate-Action29If not specified, or 0, then terminate on Session-Timeout or Quota reached, else send RADIUS Interim accounting update (not an Access Request)
Connect-Info77Text tx speed limit to apply to session
Filter-Id11See filter ID section

The session is identified by Acct-Session-Id if present, else by Chargeable-User-Identity. No other identification parameters are supported. If sent then they are ignored.

Parameters are left unchanged if not specified.

  • If any route entries (IPv4 or IPv6) are present then the existing routing (apart from the PPP endpoint address) are all removed and replaced with what has been sent. To clear all routes send a framed route with a blank string. The Framed-IP-Addreess cannot be changed.
  • To clear the session timeout send a value of 0.
  • To clear outbound shaping send connect speed of "0".

No other parameters are supported, and if sent then they are ignored

G.8. Filter ID

The Filter-ID can be set in authentication response and change of authorisation. There can be many records. Each can have many filters. Each filter is of the form of a letter possibly followed by number digits. The accounting start lists relevant filters that have been set, each in a separate filter-id AVP. Unknown filters are ignored.

Table G.9. Filter-ID

Filtermeaning
TnSet routing table for payload traffic. This can be used for private routing, and for walled garden / credit control
AnSpecify this connection is a member of a closed user group n (1-32767) but has normal IP access as well. This connection is not filtered by traffic can go to/from connections that are filtered in the same CUG
RnSpecify this connection is a member of a closed user group n (1-32767) and is restricted to sending traffic to/from connections in the same CUG.
HSets the connection to send HDLC framing headers on all PPP packets. This adds 2 extra byte to the packet. This is the default setting.
hSets the connection not to send HDLC framing headers on all PPP packets. This is in accordance with the L2TP/PPP RFCs. This does not work on BT 21CN BRASs.
FSets TCP MTU fix flag which causes the MTU option in TCP SYN to be adjusted if necessary to fit MTU.
fSets no TCP MTU fix
MSets the connection to ignore the MRU. Actually, the MRU is used to generate ICMP errors for IPv6 and IPv4 with DF set, but otherwise full size packets are sent on the connection even if a lower MRU was advised. This is in accordance with the PPP RFC but breaks some routers that do not accept 1500 byte packets (e.g. PPPoE)
mSets the connection to fragment IPv4 packets with DF not set that are too big for the advised MRU. This is teh default
LThis is not a filter and not confirmed back on accounting start and not valid on Change of Authorisation. It forces a restart of LCP negotiation. This is useful when BRASs lie about negotiated LCP (such as BTs 21CN BRASs)
lThis is not a filter and not confirmed back on accounting start and not valid on Change of Authorisation. It stops an LCP negotiation restart that may be planned, e.g. due to an MRU mismatch.
XPad packets to 74 bytes if length fields appears to be less - needed to work around bug in BT 20CN BRAS for IPv6 in IP over LCP mode
CSend all IPv4 and IPv6 using the LCP type code (only works if FireBrick doing PPP at far end)
OMark session as low-priority (see shaper and damping)
PMark session as premium (see shaper and damping)
SnSet LCP echo rate to n seconds (default 1)
snSet LCP timeout rate to n seconds (default 10)
bnDisable anti-spoofing source filtering
q[+]nSpecify [or add to] quota for tx bytes. Use either q or Q. Action depends on Terminate-Action.
Q[+]nSpecify [or add to] quota for total (tx+rx) bytes.

For change of authorisation the absence of a filter has no effect. To set normal routing table 0 zero, send T0. To set not a member of a CUG send A0.

G.9. Notes

G.9.1. L2TP relay

L2TP relay means that an incoming call (ICRQ) is relayed to another L2TP endpoint. The decision of which calls to relay to what endpoint can be made in one of two ways:-

  • Configured pattern match based on calling number, called number, or login.
  • RADIUS response to initial authentication request advising new endpoint for connection.

A test is made against the config on the initial connection based on known data. This is calling number (if present), called number (if present) and login (proxy_auth_name if present). If a match is found the call is relayed with no additional PPP packets exchanged.

If there is no proxy LCP provided, or the provided negotiation conflicts with the configuration, then LCP negotiation is completed.

If there is no proxy authentication, PPP authentication is start until a response/login is received from the peer (assuming authentication is required in the config).

At this point a further check is made for a configured relay which can now be based on a login if one was not present before.

RADIUS authentication is completed, and if the response indicates a relay then the call is relayed.

The relayed call includes the incoming call parameters, and any LCP and authentication parameters that may have been negotiated at that point.

G.9.2. LCP echo and CQM graphs

Depending on configuration, LCP echos are faked both ways from the FireBrick, and LCP echos are generated by the FireBrick and responses checked. This allows the CQM graphs to be created. The graph is only created for the outgoing part of the connection. If not configured to fake LCP echos, then these are passed through as normal and no graph is created.

Each session gets a CQM graph which uses one second LCP requests and produces detailed loss/latency graphs for the session. The graph name is picked based on the first available of :-

  • Chargeable-User-Identity sent in the RADIUS authentication response.
  • Calling-Station-Id from L2TP.
  • User-name in RADIUS athentication response.
  • Proxy-Auth-Name from L2TP.
  • Negotiated user name from PAP/CHAP.

If a second session starts with the same graph name as an existing session then the existing session is cleared with cause 13(Preempted). It is recommended that a unique circuit ID is passed as the Chargeable-User-Identity in the authentication response to allow simple location of graphs.

G.9.3. IP over LCP

IP over LCP is a non standard coding of PPP packets for IPv4 and IPv6. The coding uses the LCP code (C021) instead of the IPv4 (0021) or IPv6 (0057) code. The first byte which would normally be the LCP type is 0x4X (IPv4) or 0x6X (IPv6). The FireBrick assumes any such LCP codes are IPv4/IPv6 when received, and using a RADIUS response can send IP packets using LCP. This is specifically to bypass any carrier IP specific shaping or DPI.

G.9.4. Closed User Group

Each session can have a CUG defined (1-32768) which may be allow or restrict. Interfaces (port/VLAN) may also be defined in the same way. A packet from an interface/session with a CUG is tagged with that packet. If the source is restricted that packet can only leave via an interface/session with the same CUG. Similarly if the target interface/session is restricted than only a packet tagged with the same CUG can be sent to it.

G.9.5. Routing table

The FireBrick operates independent routing cores allowing a totally independent routing table to be used for L2TP wrapper traffic and payload traffic. It is also possible to set the payload table in use on a per session basis from RADIUS thus allowing a walled garden to be set up, or a private network, or simple an unusable session.