PBR configuration examples
Configuring local PBR based on packet type
Network requirements
As shown in
1.1.2.2 and other packets are forwarded according to the routing table.
Switch A is directly connected to Switch B and Switch C. Switch B and Switch C are unreachable to each
other.
Figure 122 Network diagram
Configuration procedure
Configure Switch A.
1.
# Define ACL 3101 to match TCP packets.
<SwitchA> system-view
[SwitchA] acl number 3101
[SwitchA-acl-adv-3101] rule permit tcp
[SwitchA-acl-adv-3101] quit
# Configure Node 5 of policy aaa to forward TCP packets to next hop 1.1.2.2.
[SwitchA] policy-based-route aaa permit node 5
[SwitchA-pbr-aaa-5] if-match acl 3101
[SwitchA-pbr-aaa-5] apply ip-address next-hop 1.1.2.2
[SwitchA-pbr-aaa-5] quit
# Apply policy aaa to Switch A.
[SwitchA] ip local policy-based-route aaa
# Configure the IP addresses of VLAN-interface 10 and VLAN-interface 20.
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] ip address 1.1.2.1 255.255.255.0
[SwitchA-Vlan-interface10] quit
[SwitchA] interface vlan-interface 20
[SwitchA-Vlan-interface20] ip address 1.1.3.1 255.255.255.0
Configure Switch B.
2.
# Configure the IP address of VLAN-interface 10.
<SwitchB> system-view
[SwitchB] interface vlan-interface 10
[SwitchB-Vlan-interface10] ip address 1.1.2.2 255.255.255.0
[SwitchB-Vlan-interface10] quit
Figure
122, configure PBR on Switch A, so that all TCP packets are forwarded to next hop
385