策略路由-接口方式
配置ACL
<R1>system-view
Enter system view, return user view with Ctrl+Z.
[R1]acl 3001
[R1-acl-adv-3001]display this
[V200R003C00]
#
acl number 3001
#
return
[R1-acl-adv-3001]rule permit ip source 1.1.1.2 0
[R1-acl-adv-3001]quit
[R1]acl 3002
[R1-acl-adv-3002]rule permit ip source 1.1.1.3 0
[R1-acl-adv-3002]quit
配置流量分类
[R1]traffic classifier ?
STRING<1-31> Name of classifier
[R1]traffic classifier aa operator ?
and Rule of matching all of the statements
or Rule of matching one of the statements
[R1]traffic classifier aa operator or ?
<cr> Please press ENTER to execute command
[R1]traffic classifier aa operator or
[R1-classifier-aa]?
classifier interface view commands:
arp-ping ARP-ping
backup Backup information
clear Clear
dialer Dialer
display Display information
if-match Specify matching statement for classification
mtrace Trace route to multicast source
ping <Group> ping command group
quit Exit from current mode and enter prior mode
reset <Group> reset command group
return Enter the privileged mode
test-aaa Accounts test
tracert <Group> tracert command group
undo Negate a command or set its defaults
[R1-classifier-aa]if-match ?
8021p Specify vlan 802.1p to match
acl Specify ACL to match
any Specify any data packet to match
app-protocol Specify app-protocol to match
cvlan-8021p Specify inner vlan 802.1p of QinQ packets to match.
cvlan-id Specify inner vlan id of QinQ packets to match.
destination-mac Specify destination MAC address to match
dlci Specify a DLCI to match
dscp Specify DSCP (DiffServ CodePoint) to match
fr-de Specify FR DE to match.
inbound-interface Specify an inbound interface to match
ip-precedence Specify IP precedence to match
ipv6 Specify IPv6
l2-protocol Specify layer-2 protocol to match
mpls-exp Specify MPLS EXP value to match
protocol Specify ipv4 or ipv6 packets to match
protocol-group Specify protocol-group to match
pvc Specify a PVC to match
rtp Specify RTP port to match
source-mac Specify source MAC address to match
tcp Specify TCP parameters to match
vlan-id Specify a vlan id to match
[R1-classifier-aa]if-match acl 3001
[R1-classifier-aa]quit
[R1]traffic classifier ?
STRING<1-31> Name of classifier
[R1]traffic classifier bb ?
operator Specify the operation relation for classification rules
<cr> Please press ENTER to execute command
[R1]traffic classifier bb op
[R1]traffic classifier bb operator or ?
<cr> Please press ENTER to execute command
[R1]traffic classifier bb operator or
[R1-classifier-bb]if-match acl 3002
配置行为
[R1]traffic behavior ?
STRING<1-31> Name of behavior
[R1]traffic behavior aa ?
<cr> Please press ENTER to execute command
[R1]traffic behavior aa
[R1-behavior-aa]?
behavior interface view commands:
arp-ping ARP-ping
backup Backup information
car Specify CAR (Committed Access Rate) feature
clear Clear
deny Specify filter deny parameters
dialer Dialer
display Display information
drop-profile Specify IP precedence based WRED
gts Specify GTS (General Traffic Shape) feature
mirror Mirroring operation of packets
mtrace Trace route to multicast source
permit Specify filter permit parameters
ping <Group> ping command group
queue Specify queue feature
queue-length Max queue length
quit Exit from current mode and enter prior mode
redirect Redirect packets
remark Remark QoS values of the packet
reset <Group> reset command group
return Enter the privileged mode
statistic Statistic
test-aaa Accounts test
tracert <Group> tracert command group
traffic-policy Specify nest policy feature
undo Negate a command or set its defaults
[R1-behavior-aa]redirect ip-nexthop 12.1.1.2 ?
post-nat Post nat
track Track nqa
<cr> Please press ENTER to execute command
[R1-behavior-aa]redirect ip-nexthop 12.1.1.2
[R1]traffic behavior bb ?
<cr> Please press ENTER to execute command
[R1]traffic behavior bb
[R1-behavior-bb]redirect ip-nexthop 13.1.1.2 ?
post-nat Post nat
track Track nqa
<cr> Please press ENTER to execute command
[R1-behavior-bb]redirect ip-nexthop 13.1.1.2
分类和行为关联
[R1]traffic ?
behavior Configure traffic behavior
classifier Configure traffic classifier
policy Configure traffic policy
[R1]traffic policy ?
STRING<1-31> Name of Traffic policy
[R1]traffic policy aa
[R1-trafficpolicy-aa]?
trafficpolicy interface view commands:
arp-ping ARP-ping
backup Backup information
classifier Specify the classifier to which policy relates
clear Clear
dialer Dialer
display Display information
mtrace Trace route to multicast source
ping <Group> ping command group
quit Exit from current mode and enter prior mode
reset <Group> reset command group
return Enter the privileged mode
test-aaa Accounts test
tracert <Group> tracert command group
undo Negate a command or set its defaults
[R1-trafficpolicy-aa]classifier aa behavior aa
[R1-trafficpolicy-aa]classifier bb behavior bb
[R1-trafficpolicy-aa]display this
[V200R003C00]
#
traffic policy aa
classifier aa behavior aa
classifier bb behavior bb
#
return
[R1-trafficpolicy-aa]
接口调用
[R1-GigabitEthernet0/0/0]traffic-policy aa ?
inbound Apply the traffic policy to the inbound direction of the interface
outbound Apply the traffic policy to the outbound direction of the interface
[R1-GigabitEthernet0/0/0]traffic-policy aa inbound ?
<cr> Please press ENTER to execute command
[R1-GigabitEthernet0/0/0]traffic-policy aa inbound