Using RADIUS to Create and Apply Policies
The E-series router enables you to use RADIUS to create and apply policies on IP interfaces. This feature supports the Ascend-Data-Filter attribute [242] through a RADIUS VSA that specifies a hexadecimal field. The hexadecimal field is encoded with policy attachment, classification, and policy action information.
The policy defined in the Ascend-Data-Filter attribute is applied when RADIUS receives a client authorization request and replies with an Access-Accept message.
When you use RADIUS to apply policies, a subset of the router's classification fields and actions is supported. The supported actions and classification fields are:
- Destination address
- Destination port
- Protocol
- Source address
- Source port
NOTE: The E-series router dynamically assigns names to the new classifier list and policy list based on information such as the interface and direction of the policy.
To create a policy, you use hexadecimal format to configure the Ascend-Data-Filter attribute on the RADIUS server. For example:
Ascend-Data-Filter="01000100 0A020100 00000000 18000000 00000000 00000000"Table 10 shows the fields in the order in which they are specified in the hexadecimal Ascend-Data-Filter attribute.
0 = no compare
1 = less than
2 = equal to
3 = greater than
4 = not equal to0 = no compare
1 = less than
2 = equal to
3 = greater than
4 = not equal to
NOTE: To create a rate-limit profile, traffic class, or marking rule, you must first configure the filter/forward field as forward.
A single RADIUS record can contain two policies—one ingress policy and one egress policy. Each policy can have a maximum of 512 ascend-data filters. Each ascend data-filter creates a classifier group and the action associated with the classifier group.
Examples—Using the Ascend-Data-Filter Attribute
This section provides examples showing the configuration of policies that use the Ascend-Data-Filter attribute.
Example 1
In this example, the following Ascend-Data-Filter attribute creates a RADIUS record that configures an input policy. The policy filters all packets from network 10.2.1.0 with wildcard mask 0.0.0.255 to any destination. The values specified in the Ascend-Data-Filter attribute are shown in Table 11.
Ascend-Data-Filter="01000100 0A020100 00000000 18000000 00000000 00000000"
Use the show classifier-list and show policy-list commands to view information about the policy:
host1#show classifier-listClassifier Control List Table---------- ------- ---- -----IP clin_5_00.1 ip 10.2.1.0 0.0.0.255 anyhost1#show policy-listPolicy Table------ -----IP Policy plin_5Administrative state: enableReference count: 1Classifier control list: clin_5_00, precedence 100filterReferenced by interface(s):ATM4/0.0 input policy, statistics enabled, virtual-router defaultReferenced by profile(s):No profile referencesExample 2
In this example, the Ascend-Data-Filter attribute is used to create RADIUS records that configure two policies. The first policy is an input policy that filters all TCP packets that come from a port greater than 9000 on host 10.2.1.1 and that go to any destination. The second policy is an output policy that filters all UDP packets from network 20.1.0.0 to host 10.2.1.1, port 3090.
Ascend-Data-Filter = "01000100 0A020101 00000000 20000600 23280000 03000000"Ascend-Data-Filter = "01000000 14010000 0A020101 10201100 00000C12 00020000"Using the show classifier-list and show policy-list commands produces the following information about the new policies:
host1#show classifier-listClassifier Control List Table---------- ------- ---- -----IP clin_6.1 tcp 10.2.1.1 gt 9000 anyIP clout_6.1 udp 20.1.0.0 0.0.255.255 10.2.1.1 eq 3090host1#show policy-listPolicy Table------ -----IP Policy plin_6Administrative state: enableReference count: 1Classifier control list: clin_6_00, precedence 100filterReferenced by interface(s):ATM4/0.0 input policy, statistics enabled, virtual-router defaultReferenced by profile(s):No profile referencesIP Policy plout_6Administrative state: enableReference count: 1Classifier control list: clout_6_01, precedence 100filterReferenced by interface(s):ATM4/0.0 output policy, statistics enabled, virtual-router defaultReferenced by profile(s):No profile referencesExample 3
This example creates an input policy and an output policy, each with multiple rules. The rules for the two policies are shown in the following list:
- Forward all TCP packets from host 10.2.1.1 to destination 20.0.0.0 0.255.255.255.
- Filter all TCP packets from host 10.2.1.1 to any destination.
- Forward all packets from host 10.2.1.1 to any destination.
- Filter all other traffic.
The rules for the input policy translate to the following VSAs. The VSAs must be specified in this order:
Ascend-Data-Filter = "01010100 0A020101 14000000 20080600 00000000 00000000"Ascend-Data-Filter = "01000100 0A020101 00000000 20000600 00000000 00000000"Ascend-Data-Filter = "01010100 0A020101 00000000 20000000 00000000 00000000"Ascend-Data-Filter = "01000100 00000000 00000000 00000000 00000000 00000000"
- Forward all TCP packets from 20.0.0.0 0.255.255.255 to host 10.2.1.1.
- Filter all TCP packets from any source to host 10.2.1.1.
- Forward all packets from any source to host 10.2.1.1.
- Filter all other traffic.
The rules for the input policy translate to the following VSAs. The VSAs must be specified in this order:
Ascend-Data-Filter = "01010000 14000000 0A020101 08200600 00000000 00000000"Ascend-Data-Filter = "01000000 00000000 0A020101 00200600 00000000 00000000"Ascend-Data-Filter = "01010000 00000000 0A020101 00200000 00000000 00000000"Ascend-Data-Filter = "01000000 00000000 00000000 00000000 00000000 00000000"Using the show classifier-list and show policy-list commands produces the following information about the new policies:
host1:vr0#show classifier-listClassifier Control List Table---------- ------- ---- -----IP clin_7_00.1 tcp host 10.2.1.1 20.0.0.0 0.255.255.255IP clin_7_01.1 tcp host 10.2.1.1 anyIP clin_7_02.1 ip host 10.2.1.1 anyIP clout_7_04.1 tcp 20.0.0.0 0.255.255.255 host 10.2.1.1IP clout_7_05.1 tcp any host 10.2.1.1IP clout_7_06.1 ip any host 10.2.1.1host1:vr0#show policy-listPolicy Table------ -----IP Policy plin_7Administrative state: enableReference count: 1Classifier control list: clin_7_00, precedence 100forwardClassifier control list: clin_7_01, precedence 100filterClassifier control list: clin_7_02, precedence 100forwardClassifier control list: *, precedence 100filterReferenced by interface(s):ATM4/0.0 input policy, statistics enabled, virtual-router defaultReferenced by profile(s):No profile referencesIP Policy plout_7Administrative state: enableReference count: 1Classifier control list: clout_7_04, precedence 100forwardClassifier control list: clout_7_05, precedence 100filterClassifier control list: clout_7_06, precedence 100forwardClassifier control list: *, precedence 100filterReferenced by interface(s):ATM4/0.0 output policy, statistics enabled, virtual-router defaultReferenced by profile(s):No profile referencesExample 4
In this example, the following Ascend-Data-Filter attribute creates a RADIUS record that configures an input policy. The policy filters TCP packets from host address 10.2.1.2 to any destination. The policy marks the packets with a ToS byte of 5 and a mask of 170. The policy also applies a traffic class named someTcl and a rate-limit profile named someRlp.
The values specified in the Ascend-Data-Filter attribute are shown in Table 12.
Ascend-Data-Filter="01010100 0a020102 00000000 20000600 045708ae 02010000 05aa0773 6f6d6554 636c0773 6f6d6552 6c70"
Use the show classifier-list and show policy-list commands to view information about the policy:
host1#show classifier-listClassifier Control List Table---------- ------- ---- -----IP clin_8_00.1 tcp host 10.2.1.2host1#show policy-listPolicy Table------ -----IP Policy plin_8Administrative state: enableReference count: 1Classifier control list: clin_8_00, precedence 100mark 5 mask 170traffic-class someTclrate-limit-profile someRlpReferenced by interface(s):ATM11/0.0 input policy, statistics enabled, virtual-router defaultReferenced by profile(s):No profile references