339
# Configure Node 0 for policy
aaa
to forward packets sourced from 192.168.10.2 to next hop
4.1.1.2, and configure Node 1 for policy
aaa
to forward other packets to next hop 5.1.1.2.
[RouterA] policy-based-route aaa permit node 0
[RouterA-pbr-aaa-0] if-match acl 2000
[RouterA-pbr-aaa-0] apply next-hop 4.1.1.2
[RouterA-pbr-aaa-0] quit
[RouterA] policy-based-route aaa permit node 1
[RouterA-pbr-aaa-1] apply next-hop 5.1.1.2
[RouterA-pbr-aaa-1] quit
# Configure interface PBR by applying policy
aaa
to GigabitEthernet 3/0.
[RouterA] interface gigabitethernet 3/0
[RouterA-GigabitEthernet3/0] ip address 192.168.10.1 24
[RouterA-GigabitEthernet3/0] ip policy-based-route aaa
[RouterA-GigabitEthernet3/0] quit
2.
Configure Router B:
# Configure an IP address for the interface.
<RouterB> system-view
[RouterB] interface gigabitethernet 1/0
[RouterB-GigabitEthernet1/0] ip address 4.1.1.2 24
[RouterB-GigabitEthernet1/0] quit
# Configure a static route to network 192.168.10.0/24.
[RouterB] ip route-static 192.168.10.0 24 4.1.1.1
3.
Configure Router C:
# Configure an IP address for the interface.
<RouterC> system-view
[RouterC] interface gigabitethernet 2/0
[RouterC-GigabitEthernet2/0] ip address 5.1.1.2 24
[RouterC-GigabitEthernet2/0] quit
# Configure a static route to network 192.168.10.0/24.
[RouterC] ip route-static 192.168.10.0 24 5.1.1.1
Verifying the configuration
# Configure IP address 192.168.10.2/24 for Host A, and specify its gateway address as 192.168.10.1.
(Details not shown.)
# Configure IP address 192.168.10.3/24 for Host B, and specify its gateway address as 192.168.10.1.
(Details not shown.)
# Ping Router B from Host A. The operation succeeds. (Details not shown.)
# Ping Router B from Host B. The operation fails. (Details not shown.)
# Ping Router C from Host A. The operation fails. (Details not shown.)
# Ping Router C from Host B. The operation succeeds. (Details not shown.)
The preceding results show that all packets sourced from 192.168.10.2 are forwarded to the next hop
4.1.1.2, and packets sourced from 192.168.10.3 are forwarded to the next hop 5.1.1.2. The interface PBR
configuration is effective.