Network requirements, Configuration procedure – H3C Technologies H3C SecPath F1000-E User Manual

Page 582

Advertising
background image

557

Configuring interface PBR based on packet length at the CLI

Network requirements

As shown in

Figure 316

, PBR is configured to control packets arriving on GigabitEthernet 0/1 of SecPath.

Configure 150.1.1.2/24 as the next hop for packets with a length of 64 to 100 bytes, and configure

151.1.1.2/24 as the next hop for packets with a length of 101 to 1000. All other packets are forwarded
according to the routing table.

Figure 316 Network diagram

Configuration procedure

NOTE:

In this example, RIP is configured to ensure the reachability among devices.

1.

Configure SecPath:
# Configure RIP.

<SecPath> system-view

[SecPath] rip

[SecPath-rip-1] network 192.1.1.0

[SecPath-rip-1] network 150.1.0.0

[SecPath-rip-1] network 151.1.0.0

[SecPath-rip-1] quit

# Define Node 10 of policy lab1, so that packets with a length of 64 to 100 bytes are forwarded

to the next hop 150.1.1.2, and packets with a length of 101 to 1000 bytes are forwarded to the
next hop 151.1.1.2.

[SecPath] policy-based-route lab1 permit node 10

[SecPath-pbr-lab1-10] if-match packet-length 64 100

[SecPath-pbr-lab1-10] apply ip-address next-hop 150.1.1.2

[SecPath-pbr-lab1-10] quit

[SecPath] policy-based-route lab1 permit node 20

[SecPath-pbr-lab1-20] if-match packet-length 101 1000

[SecPath-pbr-lab1-20] apply ip-address next-hop 151.1.1.2

[SecPath-pbr-lab1-20] quit

# Apply policy lab1 to GigabitEthernet 0/1.

[SecPath] interface GigabitEthernet 0/1

[SecPath-GigabitEthernet0/1] ip address 192.1.1.1 255.255.255.0

[SecPath-GigabitEthernet0/1] ip policy-based-route lab1

Advertising