336
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 150.1.1.1 24
[RouterA-GigabitEthernet1/0] quit
[RouterA] interface gigabitethernet 2/0
[RouterA-GigabitEthernet2/0] ip address 151.1.1.1 24
[RouterA-GigabitEthernet2/0] quit
# Configure RIP.
[RouterA] rip
[RouterA-rip-1] network 192.1.1.0
[RouterA-rip-1] network 150.1.0.0
[RouterA-rip-1] network 151.1.0.0
[RouterA-rip-1] quit
# Configure Node 10 for policy
lab1
to forward packets with a length of 64 to 100 bytes to the
next hop 150.1.1.2, and packets with a length of 101 to 1000 bytes to the next hop 151.1.1.2.
[RouterA] policy-based-route lab1 permit node 10
[RouterA-pbr-lab1-10] if-match packet-length 64 100
[RouterA-pbr-lab1-10] apply next-hop 150.1.1.2
[RouterA-pbr-lab1-10] quit
[RouterA] policy-based-route lab1 permit node 20
[RouterA-pbr-lab1-20] if-match packet-length 101 1000
[RouterA-pbr-lab1-20] apply next-hop 151.1.1.2
[RouterA-pbr-lab1-20] quit
# Configure interface PBR by applying policy
lab1
to GigabitEthernet 3/0.
[RouterA] interface gigabitethernet 3/0
[RouterA-GigabitEthernet3/0] ip address 192.1.1.1 24
[RouterA-GigabitEthernet3/0] ip policy-based-route lab1
[RouterA-GigabitEthernet3/0] quit
2.
Configure Router B:
# Configure IP addresses for the interfaces.
<RouterB> system-view
[RouterB] interface gigabitethernet 1/0
[RouterB-GigabitEthernet1/0] ip address 150.1.1.2 24
[RouterB-GigabitEthernet1/0] quit
[RouterB] interface gigabitethernet 2/0
[RouterB-GigabitEthernet2/0] ip address 151.1.1.2 24
[RouterB-GigabitEthernet2/0] quit
# Configure the loopback interface address.
[RouterB] interface loopback 0
[RouterB-LoopBack0] ip address 10.1.1.1 32
[RouterB-LoopBack0] quit
# Configure RIP.
[RouterB] rip