333
Configuration procedure
1.
Configure Router A:
# Configure IP addresses for the interfaces.
<RouterA> system-view
[RouterA] interface gigabitethernet 1/0
[RouterA-GigabitEthernet1/0] ip address 1.1.2.1 24
[RouterA-GigabitEthernet1/0] quit
[RouterA] interface gigabitethernet 2/0
[RouterA-GigabitEthernet2/0] ip address 1.1.3.1 24
[RouterA-GigabitEthernet2/0] quit
# Configure ACL 3101 to match TCP packets.
[RouterA] acl number 3101
[RouterA-acl-adv-3101] rule permit tcp
[RouterA-acl-adv-3101] quit
# Configure Node 5 for policy
aaa
to forward TCP packets to next hop 1.1.2.2.
[RouterA] policy-based-route aaa permit node 5
[RouterA-pbr-aaa-5] if-match acl 3101
[RouterA-pbr-aaa-5] apply next-hop 1.1.2.2
[RouterA-pbr-aaa-5] quit
# Configure local PBR by applying policy
aaa
to Router A.
[RouterA] ip local policy-based-route aaa
2.
On Router B, configure an IP address for the interface.
<RouterB> system-view
[RouterB] interface gigabitethernet 1/0
[RouterB-GigabitEthernet1/0] ip address 1.1.2.2 24
3.
On Router C, configure an IP address for the interface.
<RouterC> system-view
[RouterC] interface gigabitethernet 2/0
[RouterC-GigabitEthernet2/0] ip address 1.1.3.2 24
Verifying the configuration
# Telnet to Router B on Router A. The operation succeeds.
# Telnet to Router C on Router A. The operation fails.
# Ping Router C from Router A. The operation succeeds.
Telnet uses TCP, and ping uses ICMP. The preceding results show that all TCP packets sent from Router A
are forwarded to the next hop 1.1.2.2, and other packets are forwarded through GigabitEthernet 2/0.
The local PBR configuration is effective.
Packet type-based interface PBR configuration example
Network requirements
As shown in
Figure 79
, configure PBR on Router A to forward all TCP packets received on GigabitEthernet
3/0 to the next hop 1.1.2.2. Router A forwards other packets according to the routing table.