Other related questions:

1. Configure a stub area.
A stub area is a special area where ABRs do not flood received AS external routes, significantly reducing the routing table size and transmitted routing information of routers. A border area on an OSPF network is often configured as a stub area. For example, configure Area1 as a stub area.
[SwitchA] ospf 1
[SwitchA-ospf-1] area 1
[SwitchA-ospf-1-area-0.0.0.1] stub
[SwitchA-ospf-1-area-0.0.0.1] quit
[SwitchA-ospf-1] quit
Precautions:
1. To configure an area as a stub area, you must run the stub command on all the devices in this area.
2. To configure an area as a totally stub area, run the stub no-summary command on the ABR in this area and run the stub command on other devices in this area. This prevents the ABR from transmitting Type 3 LSAs to the stub area, making the area a totally stub area.
2. Configure an NSSA area.
In an NSSA, an ABR does not flood AS external routes received from other areas, similar to the situation in a stub area. The difference is that an ABR can import and flood AS external routes to the entire OSPF domain. A border area connected to another AS on an OSPF network is often configured as an NSSA. For example, configure Area2 as an NSSA.
[SwitchB] ospf 1
[SwitchB-ospf-1] area 2
[SwitchB-ospf-1-area-0.0.0.2] nssa
[SwitchB-ospf-1-area-0.0.0.2] quit
[SwitchB-ospf-1] quit
Precautions:
1. To configure an area as an NSSA, you must run the nssa command on all the devices in this area.
2. To configure an area as a totally NSSA, run the nssa no-summary command on the ABR in this area and run the nssa command on other devices in this area. This prevents the ABR from transmitting Type 3 LSAs to the NSSA, making the area a totally NSSA.

The routing protocols may share and select the routing information because a switch may run multiple dynamic routing protocols simultaneously. In this case, a priority should be set for each routing protocol. When different protocols find multiple routes to the same destination, the route discovered by the protocol with a higher priority is preferred. On an S series switch, you can run the preference command in the OSPF process view to configure the OSPF priority.
Perform the following operations:
1. Run the ospf [ process-id ] command in the system view to enter the OSPF process view.
2. Run the preference [ ase ] { preference | route-policy route-policy-name } * command to configure the OSPF priority.
The parameters are described as follows:
ase: indicates the priority of the AS-External route.
preference: indicates the OSPF route priority. A smaller value indicates a higher priority.
route-policy route-policy-name: indicates the priority for specified routes in the routing policy.
The default OSPF priority value is 10. When an ASE is specified, the default OSPF priority is 150.
For example, set the priority of routes in OSPF process 100 to 150 as follows:
[HUAWEI] ospf 100
[HUAWEI-ospf-100] preference 150

OSPF authentication of S series switches includes area authentication and interface authentication.
1. Area authentication
Run the authentication-mode command in an OSPF area view to set the authentication mode and password for the OSPF area.
For example:
[HUAWEI] ospf 100
[HUAWEI-ospf-100] area 0
[HUAWEI-ospf-100-area-0.0.0.0] authentication-mode simple cipher huawei
To configure MD5 authentication, run the following command:
[HUAWEI-ospf-100-area-0.0.0.0] authentication-mode md5 1 cipher huawei
2. Interface authentication
The interface authentication mode is used among neighbor switches to set the authentication mode and password. Its priority is higher than that of the area authentication mode. Run the ospf authentication-mode command in the interface view to set the authentication mode and password for adjacent switches.
For example:
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ospf authentication-mode simple cipher huawei
To configure MD5 authentication, run the following command:
[HUAWEI-Vlanif100]ospf authentication-mode md5 1 cipher huawei
Note: When configuring area authentication or interface authentication, all switches involved must have the same authentication mode and password. If not, the switches may fail to set up an OSPF neighbor relationship.

The ospf cost command can be executed on an S series switch that supports OSPF to configure the cost required for running the OSPF protocol on an interface.
Application scenario:
The interface cost can be automatically calculated by OSPF based on the interface bandwidth or manually configured by using the ospf cost command.
If the costs and destination IP addresses of multiple routes discovered by one routing protocol are the same, load balancing can be implemented among the routes. Modify interface costs to implement load balancing as required.
Configuration impact:
If no interface cost is configured by using the ospf cost command, OSPF automatically calculates the interface cost based on the interface bandwidth. The calculation formula is as follows: Cost of the interface = Bandwidth reference value/Interface bandwidth. The integer of the calculated result is the cost of the interface. If the calculated result is smaller than 1, the cost value is 1. Changing the bandwidth reference value can change the cost of an interface.
By default, the bandwidth reference value is 100 Mbit/s. Therefore, the default cost value of an Ethernet (100 Mbit/s) interface is 1 (100,000,000/the interface bandwidth).
Example:
Set the cost required by VLANIF 100 for running OSPF to 65.
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ospf cost 65
Set the cost required by GE0/0/1 for running OSPF to 65.
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] ospf cost 65
Note: The cost calculated by OSPF is the cost of the route to the outbound interface of the destination network.

The Open Shortest Path First (OSPF) is a routing protocol based on the link status. Unlike the routing protocols using the distance-vector (D-V) algorithm, OSPF ensures topology consistency and provides loop-free routes. To configure OSPF to filter routes, run the filter-policy import command. The record about the LSA of a route filtered out exists in the OSPF database. The OSPF process does not add the route to the routing table but the LSA of the route is advertised. That is, the peer end can receive the route. The filter-policy export command can only be used to configure OSPF to filter imported external routes to be advertised.
OSPF also supports the filtering of routes carried in Type 3 LSAs on ABRs. This feature enables ABRs to filter routes when advertising Type 3 LSAs between OSPF areas. Only the packets with prefixes meeting requirements can be transmitted from one area to another. In this way, the incoming and outgoing packets of an area are controlled.