< Home

Enabling OSPF

Context

After creating an OSPF process, you need to configure the network segments to which the IP addresses of OSPF interfaces belong in an area. Each interface that runs OSPF must belong to an area, meaning that a network segment can belong to only one area.

OSPF checks the network mask carried in received Hello packets. If the network mask carried in such a packet is different from that of the local device, OSPF discards the Hello packet and does not establish any OSPF neighbor relationship.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run ospf [ process-id ]

    The OSPF process view is displayed.

  3. Run area area-id

    The OSPF area view is displayed.

    OSPF can be enabled in an OSPF area or on a specific interface.

    • Enable OSPF in an OSPF area.

    1. Run network ip-address wildcard-mask

      A network segment belonging to an area is configured.

      OSPF can run on an interface only when the following conditions are met:

      • The IP address mask length of the interface is greater than or equal to the mask length converted from the wildcard mask specified in the network command.

      • The primary IP address of the interface resides in the network segment specified in the network command.

      By default, OSPF advertises the IP address of a loopback interface as a 32-bit host route, which is independent from the mask length configured on the loopback interface. To advertise routes to the network segment where the loopback interface resides, configure the network type as NBMA or broadcast in the interface view. For details, see Configuring Network Types for OSPF Interfaces.

    • Enable OSPF on a specific interface.

    1. Run interface interface-type interface-number

      The interface view is displayed.

    2. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.

      Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support switching between Layer 2 and Layer 3 modes.

    3. Run ospf enable [ process-id ] area area-id

      OSPF is enabled on the interface.

      A decimal integer or an IPv4 address in dotted-decimal notation can be entered as the area ID, but the area ID is displayed always as an IPv4 address in dotted-decimal notation.

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