335
<RouterB> system-view
[RouterB] interface gigabitethernet 1/0
[RouterB-GigabitEthernet1/0] ip address 1.1.2.2 24
[RouterB-GigabitEthernet1/0] quit
# Configure a static route to subnet 10.110.0.0/24.
[RouterB] ip route-static 10.110.0.0 24 1.1.2.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 1.1.3.2 24
[RouterC-GigabitEthernet2/0] quit
# Configure a static route to subnet 10.110.0.0/24.
[RouterC] ip route-static 10.110.0.0 24 1.1.3.1
Verifying the configuration
# Configure the IP address 10.110.0.20/24 for Host A, and specify its gateway address as 10.110.0.10.
# On Host A, Telnet to Router B that is directly connected to Router A. The operation succeeds.
# On Host A, Telnet to Router C that is directly connected to Router A. The operation fails.
# Ping Router C from Host A. The operation succeeds.
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.1.2.2, and other packets are forwarded
through GigabitEthernet 2/0. The interface PBR configuration is effective.
Packet length-based interface PBR configuration example
Network requirements
As shown in
Figure 80
, configure 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.1.1.2/24.
•
Set the next hop of packets with a length of 101 to 1000 bytes to 151.1.1.2/24.
Router A forwards other packets according to the routing table.
Figure 80
Network diagram