431
Telnet uses TCP, and ping uses ICMP. The preceding results show that all TCP packets arriving on
GigabitEthernet 3/0 of Router A are forwarded to the next hop 1::2, and other packets are forwarded
through GigabitEthernet 2/0. The IPv6 interface PBR configuration is effective.
Packet length-based IPv6 interface PBR configuration example
Network requirements
As shown in
Figure 99
, configure IPv6 interface PBR to guide the forwarding of packets received on
GigabitEthernet 3/0 of Router A as follows:
•
Set the next hop of packets with a length of 64 to 100 bytes to 150::2/64.
•
Set the next hop of packets with a length of 101 to 1000 bytes to 151::2/64.
Router A forwards other packets according to the routing table.
Figure 99
Network diagram
Configuration procedure
1.
Configure Router A:
# Configure RIPng.
<RouterA> system-view
[RouterA] ripng 1
[RouterA-ripng-1] quit
[RouterA] interface gigabitethernet 1/0
[RouterA-GigabitEthernet1/0] ipv6 address 150::1 64
[RouterA-GigabitEthernet1/0] ripng 1 enable
[RouterA-GigabitEthernet1/0] quit
[RouterA] interface gigabitethernet 2/0
[RouterA-GigabitEthernet2/0] ipv6 address 151::1 64
[RouterA-GigabitEthernet2/0] ripng 1 enable
[RouterA-GigabitEthernet2/0] quit
# Configure Node 10 for policy
lab1
to forward packets with a length of 64 to 100 bytes to the
next hop 150::2/64, and packets with a length of 101 to 1000 bytes to the next hop 151::2/64.
[RouterA] ipv6 policy-based-route lab1 permit node 10
[RouterA-pbr6-lab1-10] if-match packet-length 64 100
[RouterA-pbr6-lab1-10] apply next-hop 150::2
[RouterA-pbr6-lab1-10] quit
[RouterA] ipv6 policy-based-route lab1 permit node 20
[RouterA-pbr6-lab1-20] if-match packet-length 101 1000
[RouterA-pbr6-lab1-20] apply next-hop 151::2