< Home

Configuring OSPF to Filter Routes Received by OSPF

By configuring filtering conditions for the received routes, you can allow only the routes that meet the filtering conditions to be added to the routing table.

Context

OSPF is a dynamic routing protocol based on the link state, and routing information is hidden in the link state. Therefore, the filter-policy import command cannot be used to filter the advertised and received LSAs. You can then run the filter-policy import command to filter the routes calculated by OSPF. Only the routes that match the filtering rules are added to the routing table.

The filter-policy import command is used to filter only the routes that match OSPF and are installed to the local routing table. Routes that do not pass the filtering are neither added to the OSPF routing table nor advertised. Therefore, whether the received routes pass the filtering or not, the LSDB is not affected.

Procedure

  1. Access the system view.

    system-view

  2. Access the OSPF process view.

    ospf [ process-id ]

  3. Configure the route filtering function to filter the routes received.

    filter-policy { acl-number | ip-prefix ip-prefix-name | route-policy route-policy-name [ secondary ] } import

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >