Dynamic Template Commands

This module describes the Cisco IOS XR software commands used to configure the Dynamic Template commands for Broadband Network Gateway (BNG) on the Cisco ASR 9000 Series Router. For details regarding the related configurations, refer to the Cisco ASR 9000 Series Aggregation Services Router Broadband Network Gateway Configuration Guide.

To use commands of this module, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using any command, contact your AAA administrator for assistance.

dynamic-template

To group a set of configuration items that can be applied to a group of subscribers and to enter the dynamic-template configuration mode, use the dynamic-template command in the Global Configuration mode. To disable this feature and exit the dynamic-template configuration mode, use the no form of this command.

dynamic-template type {ipsubscriber name | ppp name | service name}

Syntax Description

type

Specifies the type of templates, for example, ppp or ipsubscriber or service.

name

Specifies the name of the dynamic template type.

ipsubscriber

Specifies the ipsubscriber dynamic template type.

ppp

Specifies the ppp dynamic template type.

service

Specifies the service dynamic template type.

Command Default

None

Command Modes

Global Configuration mode

Command History

Release Modification

Release 4.2.0

This command was introduced.

Usage Guidelines

Use the dynamic-template command to enter dynamic template configuration mode.

Task ID

Task ID Operation

config-services

read, write

Examples

This is an example of configuring the dynamic-template command in the Global Configuration mode:


RP/0/RSP0/CPU0:router# configure
RP/0/RSP0/CPU0:router(config)# dynamic-template
RP/0/RSP0/CPU0:router(config-dynamic-template)# 

dynamic-template type ipsubscriber

To group a set of configuration items that can be applied to a group of subscribers based on the ipsubscriber template type and to enter the dynamic-template configuration mode, use the dynamic-template type ipsubscriber command. To disable this feature and exit the dynamic-template configuration mode, use the no form of this command.

dynamic-template type ipsubscriber template-name

Syntax Description

template-name

Specifies the dynamic template name.

Command Default

None

Command Modes

Dynamic template configuration mode

Command History

Release Modification

Release 4.2.0

This command was introduced.

Usage Guidelines

Use the dynamic-template command to enter dynamic template configuration mode.

Task ID

Task ID Operation

config-services

read, write

Examples

This is an example of configuring the dynamic-template type ipsubscriber command:


RP/0/RSP0/CPU0:router# configure
RP/0/RSP0/CPU0:router(config)# dynamic-template
RP/0/RSP0/CPU0:router(config-dynamic-template)# type ipsubscriber ipsub1

dynamic-template type ppp

To group a set of configuration items that can be applied to a group of subscribers based on the ppp template type and to enter the dynamic-template configuration mode, use the dynamic-template type ppp command. To disable this feature and exit the dynamic-template configuration mode, use the no form of this command.

dynamic-template type ppp template-name

Syntax Description

template-name

Specifies the dynamic template name.

Command Default

None

Command Modes

Dynamic template configuration mode

Command History

Release Modification

Release 4.2.0

This command was introduced.

Usage Guidelines

Use the dynamic-template command to enter dynamic template configuration mode.

Task ID

Task ID Operation

config-services

read, write

Examples

This is an example of configuring the dynamic-template type ppp command:


RP/0/RSP0/CPU0:router# configure
RP/0/RSP0/CPU0:router(config)# dynamic-template
RP/0/RSP0/CPU0:router(config-dynamic-template)# type ppp p1

dynamic-template type service

To group a set of configuration items that can be applied to a group of subscribers based on the service template type and to enter the dynamic-template configuration mode, use the dynamic-template type service command. To disable this feature and exit the dynamic-template configuration mode, use the no form of this command.

dynamic-template type service template-name

Syntax Description

template-name

Specifies the dynamic template name.

Command Default

None

Command Modes

Dynamic template configuration mode

Command History

Release Modification

Release 4.2.0

This command was introduced.

Usage Guidelines

Use the dynamic-template command to enter dynamic template configuration mode.

Task ID

Task ID Operation

config-services

read, write

Examples

This is an example of configuring the dynamic-template type service command:


RP/0/RSP0/CPU0:router# configure
RP/0/RSP0/CPU0:router(config)# dynamic-template
RP/0/RSP0/CPU0:router(config-dynamic-template)# type service s1

monitor-session (interface-dynamic-template-BNG)

To associate a traffic mirroring session with a specific interface, use the monitor-session command in interface configuration mode or dynamic-template configuration mode. To remove the association between a traffic mirroring session and an interface, use the no form of this command.

monitor-session session-name [direction {rx-only | tx-only}] [port-level]

Syntax Description

session-name

Name of the monitor session to configure.

direction

Specifies that traffic replication is in only one direction.

rx-only

Specifies that only ingress traffic is replicated.

tx-only

Specifies that only egress traffic is replicated.

Command Default

Replicates both ingress and egress traffic.

Command Modes

Interface configuration

Dynamic template configuration (for BNG)

Command History

Release

Modification

Release 3.9.1

This command was introduced.

Release 4.0.0

The acl and mirror first keywords were added.

Release 5.1

The support for this command under dynamic-template configuration mode was added for BNG.

Usage Guidelines

Before you can associate a traffic mirroring session to a specific interface, you must define it using the monitor-session global configuration command. After the traffic mirroring session is defined, use the monitor-session interface configuration command or dynamic template configuration command to associate this session with a specific source interface. For BNG sessions, the subscriber is attached to the monitor session, only when the dynamic template is applied to the subscriber. When the session is associated, all specified traffic on the interface is then replicated to the destination location defined in the monitor session configuration.

The monitor-session interface configuration command also enters monitor session configuration mode for you to configure additional features of the mirroring session.

If a physical interface is configured for Layer 3, then the traffic mirroring session can be associated on physical interfaces. Example:
interface TenGigE0/1/0/0
ipv4 address 10.0.0.1 255.255.255.0

If a physical interface has sub-interfaces configured for Layer 3, then the traffic mirroring session must be associated on each sub-interface. Example:

interface TenGigE0/1/0/1.601
ipv4 address 10.0.1.1 255.255.255.0
encapsulation dot1q 601

For more information about monitoring a session, see Configuring Traffic Monitoring chapter in Cisco ASR 9000 Series Aggregation Services Router Interface and Hardware Component Configuration Guide.

Task ID

Task ID

Operations

interface

read, write

config-services

read, write

Examples

This example shows how to enter monitor session configuration mode:


RP/0/RSP0/CPU0:router# configure 
RP/0/RSP0/CPU0:router(config)# interface gigabitethernet0/0/0/11
RP/0/RSP0/CPU0:router(config-if)# l2transport 
RP/0/RSP0/CPU0:router(config-if-l2)# monitor-session mon1
RP/0/RSP0/CPU0:router(config-if-mon)#
   

This example shows how to configure monitor-session command in the dynamic-template configuration mode for BNG:


RP/0/RSP0/CPU0:router# configure 
RP/0/RSP0/CPU0:router(config)# dynamic-template type ppp ppp_template
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# monitor-session mon1 direction rx-only 
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# acl
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# mirror first 100

service-policy (BNG)

To associate a service-policy to the dynamic template, use the service-policy command in the dynamic template configuration mode. To disable this feature, use the no form of this command.

service-policy {input | output | type} service-policy_name [acct-stats] [merge seq_num]

Syntax Description

input

Configures an ingress service-policy.

output

Configures an egress service-policy.

type

Creates the service policy for policy-based routing (PBR).

service-policy_name

Name of the service policy.

acct-stats

(Optional) Enables service accounting.

merge

(Optional) Enables the policy to be merged.

seq_num

Sequence number of the policy. Range is from 0 to 255.

Command Default

None

Command Modes

Dynamic template configuration mode

Command History

Release Modification

Release 4.2.0

This command was introduced.

Release 4.3.0

Support was added for policy based routing.

Release 4.3.1

acct-stats and merge keywords were added to support service accounting and policy merge features.

Usage Guidelines

Use the dynamic-template type ppp command to enter the ppp dynamic template type configuration mode.

Task ID

Task ID Operation

qos

read, write

Examples

This is an example of configuring the service-policy command in the dynamic template configuration mode:


RP/0/RSP0/CPU0:router# configure
RP/0/RSP0/CPU0:router(config)# dynamic-template type ppp p1
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# accounting aaa list default type session periodic-interval 60 dual-stack-delay 1
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# service-policy input i1
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# service-policy output o1
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# service-policy type pbr pbr_policy

This example shows how to enable service accounting feature in the dynamic template configuration mode using service-policy command:


RP/0/RSP0/CPU0:router# configure
RP/0/RSP0/CPU0:router(config)# dynamic-template type service s1
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# accounting aaa list l1 type service periodic-interval 500
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# ipv4 access-group ACL1 
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# service-policy input QoS1 acct-stats
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# service-policy output QoS2 acct-stats

This example shows how to merge policy maps using service-policy command in the dynamic template configuration mode:


RP/0/RSP0/CPU0:router# configure
RP/0/RSP0/CPU0:router(config)# dynamic-template type service MyService
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# service-policy input i1 merge 20
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# service-policy output o1 merge 30

test radius coa activate

To enable Traffic Mirroring, also known as Switch Port Analyzer (SPAN), on a BNG subscriber interface, use the test radius coa activate command in EXEC mode. To disable SPAN, use the deactivate form of this command.

test radius coa activate service name acct-ses-id id

test radius coa deactivate service name acct-ses-id id

Syntax Description

service

Specifies the service to be activated or de-activated.

name

Name of the service, which is same as the dynamic-template name.

acct-ses-id

Specifies the accounting session ID of the subscriber on which the template is to be activated or de-activated.

id

ID of the accounting session, in hexadecimal format .

Command Default

None

Command Modes

EXEC mode

Command History

Release Modification

Release 5.1

This command was introduced.

Usage Guidelines

Configure monitor sessions (using monitor-session command in Global Configuration mode) and configure source interface attachment to a monitor session (using dynamic templates), as a pre-requisite for executing test radius coa activate command.

Task ID

Task ID Operation

network

read, write

Examples

This example shows how to enable SPAN on BNG subscriber interface by associating a dynamic template with a specific subscriber :


RP/0/RSP0/CPU0:router# test radius coa activate acct-ses-id 0x00000001 service service1

This example shows how to disable SPAN on BNG subscriber interface by dis-associating a dynamic template with a specific subscriber :


RP/0/RSP0/CPU0:router# test radius coa deactivate acct-ses-id 0x00000001 service service1

timeout idle

To configure an idle timeout period for the IPoE and PPPoE subscriber sessions on BNG, use the timeout idle command in dynamic template type configuration mode. To disable this feature, use the no form of this command.

timeout idle seconds [threshold rate] [traffic {both | inbound | outbound}]

Syntax Description

seconds

Idle timeout value for the subscriber sessions, in seconds.

The range is from 60 to 4320000.

threshold

Configures a threshold to track the duration of session idleness.

duration

Duration of threshold, in minute(s) per packet.

The range is from 1 to 10000. Default is 0.

Note

 

This value should be less than the idle timeout value.

traffic

Considers the direction of traffic while deriving the duration of session idleness.

The default is inbound direction.

both

Considers inbound and outbound traffic while deriving the duration of session idleness.

inbound

Considers inbound traffic only while deriving the duration of session idleness.

outbound

Considers outbound traffic only while deriving the duration of session idleness.

Command Default

None

Command Modes

Dynamic template type configuration

Command History

Release Modification

Release 4.2.1

This command was introduced.

Release 5.1

The support for threshold and traffic keywords were added.

Usage Guidelines

In Cisco IOS XR software release 4.2.1, both the IPoE and PPPoE sessions are retained idle, when the idle timeout period expires. In Cisco IOS XR software release 4.2.3, only the IPoE sessions are terminated when the idle timeout period expires. Whereas, the PPPoE sessions are retained idle. From Cisco IOS XR software release 5.1.0 and later, both IPoE and PPPoE sessions are terminated on the expiry of the idle timeout period.

If packets sent or received by BNG, in the configured threshold interval is less than that threshold value, then that particular session is considered idle. For instance, if the threshold is configured as 2 packets/minute, and, if the number of packets received in every 2 minutes is only less than 2 (either 0 or 1), then that particular session is considered as idle. Whereas, if the number of packets received is 2 or above, then that session is considered as active.

By default, the sessions are disconnected if the threshold is not configured.

Task ID

Task ID Operation

config-services

read, write

Examples

This example shows how to configure an idle timeout of 200 seconds, with a threshold of 2 minutes/packet and considering inbound and outbound traffic for determining the duration of session idleness:


RP/0/RSP0/CPU0:router# configure
RP/0/RSP0/CPU0:router(config)# dynamic-template type ppp ppp1
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# timeout idle 200 threshold 2 traffic both

vrf (dynamic-template-BNG)

To set the vrf in which the interface operates, use the vrf command in the dynamic template type configuration mode. To disable the VRF, use the no form of this command.

vrf vrf-name

Syntax Description

vrf_name

Specifies the name of the vrf.

Command Default

None

Command Modes

Dynamic template type configuration mode

Command History

Release Modification

Release 4.2.0

This command was introduced.

Usage Guidelines

Use the dynamic-template command to enter dynamic template configuration mode.

Task ID

Task ID Operation

config-services

read, write

Examples

This is an example of configuring the vrf command in the dynamic template type configuration mode:


RP/0/RSP0/CPU0:router# configure
RP/0/RSP0/CPU0:router(config)# dynamic-template
RP/0/RSP0/CPU0:router(config-dynamic-template)# type service s1
RP/0/RSP0/CPU0:router(config-dynamic-template-type)# vrf vrf1