Configuring Tracking Plug-Ins (SRC CLI)
You can perform the following tasks to configure tracking plug-ins:
Configuring Flat File Accounting Plug-Ins
Flat file accounting plug-ins write information to a file in a comma-separated format. The SRC software has a default flat file accounting plug-in instance called fileAcct. The fileAcct instance logs all possible attributes for 24-hour periods in the file var/acct/log.
Another item that you can configure for flat files is the names of the headers that appear in the file.
Use the following configuration statements to create flat-file accounting plug-in instances:
To create flat-file accounting plug-ins:
- From configuration mode, access the basic RADIUS accounting
plug-in configuration. In this sample procedure, the plug-in called
fileAcct is configured in the west-region SAE group. user@host# edit shared sae group west-region configuration plug-ins name fileAcct file-accounting
- Configure the name and location of the file to which the
SAE writes accounting information.[edit shared sae group west-region configuration plug-ins name fileAcct file-accounting] user@host# set filename filename
- Configure the name of the template that defines header
names for attributes listed in accounting files. [edit shared sae group west-region configuration plug-ins name fileAcct file-accounting] user@host# set template template
- Configure the number of hours of information stored in
each accounting file. [edit shared sae group west-region configuration plug-ins name fileAcct file-accounting] user@host# set interval interval
- Configure the fields that you want to record in the accounting
file.[edit shared sae group west-region configuration plug-ins name fileAcct file-accounting] user@host# set fields [(status | nas-id | host | router-name | interface-name | interface-alias | interface-descr | port-id | user-ip-address | login-name | accounting-id | auth-user-id | if-radius-class | if-session-id | service-name | radius-class | event-time | session-id | terminate-cause | session-time | in-octets | out-octets | in-packets | out-packets | nas-ip | user-mac-address | service-session-name | service-session-tag | user-type | user-radius-class | user-session-id | primary-user-name | subscription-name | login-id | if-index | event-time-millisecond | remote-tunnel-inet-address | nas-port | operational | user-inet-address | nas-inet-address | router-type | interface-speed | calling-station-id | vpn-id)...]
- (Optional) Verify your configuration.
[edit shared sae group west-region configuration plug-ins name fileAcct file-accounting] user@host# show filename var/acct/log; template FileAccounting.std; interval 24; fields [ status nas-id host router-name interface-name interface-alias interface-descr port-id user-inet-address login-name accounting-id auth-user-id if-session-id service-name event-time session-id terminate-cause session-time in-octets out-octets in-packets out-packets nas-inet-address user-mac-address service-session-name service-session-tag user-type user-session-id ];
Configuring Headers for Flat File Accounting Plug-Ins
When the SAE writes data to a flat file, it writes into the first line the headers that identify the attributes in the file. For example, in the following accounting file, the first line lists headers for all attribute fields in the file, and the following lines list the actual data in each field:
NAS port ID,User IP Address,User ID,User Accounting ID,User Authentication ID,INTF Radius Class,INTF,SessionId,
Service Name,Radius Class,Timestamp,SessionId, Terminate Cause,Session Time,Input Octets,Output Octets,
Input Packets,Output Packets,NAS IP,User Mac address,Service Session Name,Service Session Tag,User Session Type,
User Session Radius Class,User Session IDstart,SSP.uelmo,uelmo,default@erx7_ssp57,FastEthernet1/1.1,,IP1/1.1,default@erx7_ssp57 FastEthernet1/1:65535,
10.10.10.20,pebbles@virneo.net,,,,erx fastEthernet 1/1:0001048619,Video-Gold,Video-Gold,Fri Jan 30 14:23:29 EDT 2004,
VideoGold:null:1064946209182, 0,0,0,0,0,0, 10.10.7.17,,,,PPP,, pebbles:1064946144841
You can assign your own names to the headers that appear in the file. To do so, define the header names in a template, and then set up file accounting plug-in instances to use the template. The default template, FileAccounting.std, defines header names for all possible attributes. You can use the default template or create your own templates.
Use the following configuration statements to create a file accounting template:
To set up a file accounting template:
- From configuration mode, access the file accounting template
configuration. In this sample procedure, the template called std is
configured in the west-region SAE group. user@host# edit shared sae group west-region configuration file-accounting-template std
- Define header names. [edit shared sae group west-region configuration file-accounting-template std]user@host# set attributes attribute value
For example:
[edit shared sae group west-region configuration file-accounting-template std]user@host# set attributes terminate-cause "RADIUS Termination Cause" - (Optional) Verify your configuration.
[edit shared sae group west-region configuration file-accounting-template std] user@host# show attributes { terminate-cause "RADIUS Termination Cause"; service-session-name "Service Session Name"; }
Configuring Basic RADIUS Accounting Plug-Ins
You can use basic RADIUS accounting plug-ins to send accounting information to an external RADIUS accounting server or to a group of redundant servers. To communicate with nonredundant servers, you need to create multiple instances of the plug-in.
Use the following configuration statements to configure RADIUS accounting plug-ins:
To set up basic RADIUS accounting plug-ins:
- From configuration mode, access the basic RADIUS accounting
plug-in configuration. In this sample procedure, the plug-in called
basicRadius is configured in the west-region SAE group. user@host# edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting
- Configure the mode for load-balancing RADIUS servers.[edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting] user@host# set load-balancing-mode (failover | roundRobin)
- Specify if and when the SAE attempts to fail back to the
default peer. [edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting] user@host# set failback-timer failback-timer
- (Optional) Configure the value of the NAS-IP attribute. [edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting] user@host# set nas-ip (SspIp | ErxIp)
- Configure the time the SAE waits for a response from a
RADIUS server before it resends the RADIUS packet. [edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting] user@host# set retry-interval retry-interval
- Configure the maximum number of unacknowledged RADIUS
messages that the plug-in receives from the RADIUS server before it
discards new messages. [edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting] user@host# set maximum-queue-length maximum-queue-length
- (Optional) Configure the source IP address that the plug-in
uses to communicate with the RADIUS server. If you do not specify
an address, the global default address is used. [edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting] user@host# set bind-address bind-address
- (Optional) Configure the source UDP port or a range of
source UDP ports used for communication with the RADIUS server. If
you do not specify a UDP port, the global UDP port is used. [edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting] user@host# set udp-port udp-port
- Configure the value of the User-Name attribute (RADIUS
attribute [1]). [edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting] user@host# set username (login-name | accounting-id | auth-user-name | manager-id)
- Specify whether the SAE sends the MAC address of the subscriber
in the Calling-Station-Id attribute. [edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting] user@host# set calling-station-id (mac | no)
- Configure the default peer, which is the RADIUS server
to which the SAE sends packets for this plug-in. [edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting] user@host# set default-peer default-peer
- (Optional) Verify your configuration.
[edit shared sae group west-region configuration plug-ins name basicRadius radius-accounting] user@host# show load-balancing-mode failover; failback-timer -1; retry-interval 3000; maximum-queue-length 10000; username login-name; calling-station-id no; default-peer peer1;
Configuring Flexible RADIUS Accounting Plug-Ins
Flexible RADIUS accounting plug-ins provide the same features as basic RADIUS accounting plug-ins. In addition, they allow you to customize RADIUS accounting packets that the SAE sends to RADIUS servers. You can specify which fields are included in the RADIUS accounting packets and what information is contained in the fields.
Use the following configuration statements to configure flexible RADIUS accounting plug-ins:
To set up flexible RADIUS accounting plug-ins:
- From configuration mode, access the flexible RADIUS accounting
plug-in configuration. In this sample procedure, the plug-in called
flexRadiusAct is configured in the west-region SAE group. user@host# edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting
- Configure the mode for load-balancing RADIUS servers.[edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting] user@host# set load-balancing-mode (failover | roundRobin)
- Specify if and when the SAE attempts to fail back to the
default peer. [edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting] user@host# set failback-timer failback-timer
- (Optional) Configure the maximum time the SAE waits for
a response from a RADIUS server. [edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting] user@host# set timeout timeout
- Configure the time the SAE waits for a response from a
RADIUS server before it resends the RADIUS packet. [edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting] user@host# set retry-interval retry-interval
- Configure the maximum number of unacknowledged RADIUS
messages that the plug-in receives from the RADIUS server before it
discards new messages. [edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting] user@host# set maximum-queue-length maximum-queue-length
- (Optional) Configure the source IP address that the plug-in
uses to communicate with the RADIUS server. If you do not specify
an address, the global default address is used. [edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting] user@host# set bind-address bind-address
- (Optional) Configure the source UDP port or a range of
source UDP ports used for communication with the RADIUS server. If
you do not specify a UDP port, the global UDP port is used. [edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting] user@host# set udp-port udp-port
- Configure the way the SAE handles errors. [edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting] user@host# set error-handling (0 | 1)
- Configure the name of the RADIUS server to which the SAE
sends packets for this plug-in. [edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting] user@host# set default-peer default-peer
- Configure the name of the RADIUS packet template that
defines attributes for this plug-in.[edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting] user@host# set template template
- (Optional) Verify your configuration.
[edit shared sae group west-region configuration plug-ins name flexRadiusAct flex-radius-accounting] user@host# show load-balancing-mode failover; failback-timer -1; timeout 15000; retry-interval 3000; maximum-queue-length 10000; error-handling 0; default-peer peer2; template stdAcct; peer-group peer2 { server-address 10.10.1.1; server-port 1818; secret ********; }
Configuring Custom RADIUS Accounting-Plug-Ins
The custom RADIUS accounting plug-ins provide the same functions as the flexible RADIUS accounting plug-ins, but are designed to deliver better system performance. To use a custom plug-in, you must provide a Java class that implements the service provider interface (SPI) defined in the RADIUS client library. Use this SPI to specify which fields and field values to include in RADIUS accounting packets. The RADIUS client library is part of the SAE core application programming interface (API).
See the documentation for the RADIUS client library in the SAE core API documentation on the Juniper Networks Web site at
For a sample implementation, see the SDK+AppSupport+Demos+Samples.tar.gz
file on the
Juniper Networks Web site at: https://www.juniper.net/support/products/src/index.html#sw. The application is located the following directory:
SDK/plugin/java/src/net/juniper/smgt/sample/radiuslib/RadiusPacketHandlerImpl.java.
Use the following configuration statements to set up custom RADIUS accounting plug-ins:
To set up custom RADIUS accounting plug-ins:
- From configuration mode, access the custom RADIUS accounting
plug-in configuration. In this sample procedure, the plug-in called
customRadiusAct is configured in the west-region SAE group. user@host# edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting
- Configure the name of the Java class that implements the
RadiusPacketHandler interface in the RADIUS client library.[edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# set java-class-radius-packet-handler java-class-radius-packet-handler
- Configure the URLs that identify a location from which
Java classes are loaded when the plug-in is initialized.[edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting user@host# set class-path-radius-packet-handler class-path-radius-packet-handler
- (Optional) Enable the plug-in to include the Acct-Status-Type
attribute in a RADIUS accounting request packet.[edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# set append-acct-status-type-attribute
- (Optional) Specify that a RADIUS authentication or accounting
request must contain all mandatory RADIUS attributes before sending
the request packet. [edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# set require-mandatory-attributes
- Configure the mode for load-balancing RADIUS servers.[edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# set load-balancing-mode (failover | roundRobin)
- Specify if and when the SAE attempts to fail back to the
default peer. [edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# set failback-timer failback-timer
- (Optional) Configure the maximum time the SAE waits for
a response from a RADIUS server. [edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# set timeout timeout
- Configure the time the SAE waits for a response from a
RADIUS server before it resends the RADIUS packet. [edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# set retry-interval retry-interval
- Configure the maximum number of unacknowledged RADIUS
messages that the plug-in receives from the RADIUS server before it
discards new messages. [edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# set maximum-queue-length maximum-queue-length
- (Optional) Configure the source IP address that the plug-in
uses to communicate with the RADIUS server. If you do not specify
an address, the global default address is used. [edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# set bind-address bind-address
- (Optional) Configure the source UDP port or a range of
source UDP ports used for communication with the RADIUS server. If
you do not specify a UDP port, the global UDP port is used. [edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# set udp-port udp-port
- Configure the name of the RADIUS server to which the SAE
sends packets for this plug-in. [edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# set default-peer default-peer
- (Optional) From operational mode, verify your configuration.
[edit shared sae group west-region configuration plug-ins name customRadiusAct custom-radius-accounting] user@host# show java-class-radius-packet-handler net.juniper.smgt.radius.RadiusPacketHandlerImpl; append-acct-status-type-attribute; load-balancing-mode failover; failback-timer -1; timeout 15000; retry-interval 3000; maximum-queue-length 10000; default-peer peer3;