Configure an OSPF area on a VLAN or port

Import information from other areas to learn their OSPF relationships. Perform this procedure to create normal, stubby, or NSSA. Place stubby or NSSAs at the edge of an OSPF routing domain.

Before you begin

  • Enable OSPF globally.

  • Ensure that the VLAN exists.

About this task

Ensure that you configure all routers in a stubby or NSSA as stubby or NSSA, respectively.

To configure OSPF areas on a VRF instance for a port or VLAN, you configure OSPF on the port or VLAN, and then associate the port or VLAN with the VRF.

Procedure

  1. Enter Interface Configuration mode:

    enable

    configure terminal

    interface GigabitEthernet {slot/port[/sub-port][-slot/port[/sub-port]][,...]} or interface vlan <1–4059>

    Note

    Note

    If the platform supports channelization and the port is channelized, you must also specify the sub-port in the format slot/port/sub-port.

  2. Create an OSPF area on the VLAN or port:

    ip ospf area {A.B.C.D}

  3. Specify the type of network:

    ip ospf network <broadcast|nbma|passive|p2p>

  4. Configure other OSPF area parameters as required.

Example

Create an OSPF area 192.0.2.2 on VLAN 1, and specify the type of network as broadcast.

Switch:1>enable
Switch:1#configure terminal
Switch:1(config)#interface vlan 1
Switch:1(config-if)#ip ospf area 192.0.2.2
Switch:1(config-if)#ip ospf network broadcast

Variable Definitions

The following table defines parameters for the ip ospf command.

Variable

Value

{A.B.C.D}

Specifies the area ID.

authentication-key WORD<0-8>

Configures the eight-character simple password authentication key for the port or VLAN.

authentication-type <message-digest|none|sha-1|sha-2|simple>

Specifies the type of authentication required for the interface.

  • none—Specifies that no authentication required.

  • simple password—Specifies that all OSPF updates received by the interface must contain the authentication key specified in the interface AuthKey parameter.

  • MD5 authentication—Specifies that all OSPF updates received by the interface must contain the MD5 key.

  • sha-1—Specifies secure hash algorithm 1 (SHA-1), which is a cryptographic hash function that produces a 160-bit hash value, usually given in a hexadecimal number, 40 digits long.

  • sha-2—Specifies SHA-2, which offers the hash function SHA-256.

    Note:

    sha-2, an update of SHA-1, can offer six hash functions that include SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA 512/256, with hash values that are 224, 256, 384, or 512 bits. However, the current release supports only SHA-256.

cost <0-65535>

Configures the OSPF cost associated with this interface and advertised in router link advertisements. The default is 0.

dead-interval <0-2147483647>

Configures the number of seconds between router hello packets before neighbors declare the router down. This value must be at least four times the hello interval value. The default is 60.

hello-interval <1-65535>

Configures the hello interval, in seconds, on the virtual interface for the length of time (in seconds) between the hello packets that the router sends on the interface. The default is 10.

mtu-ignore enable

Enables MTU ignore. To allow the switch to accept OSPF database description (DD) packets with a different MTU size, enable mtu-ignore. The interface drops incoming OSPF DD packets if their MTU is greater than 1500 bytes.

network <broadcast|nbma|passive|p2p>

Specifies the type of OSPF interface.

poll-interval <0-2147483647>

Configures the OSPF poll interval in seconds. The default is 120.

primary-digest-key <1-255>

Use this parameter to transition to a new MD5 key; it changes the primary key used to encrypt outgoing packets.

<1-255> is the ID for the message digest key.

priority <0-255>

Configures the OSPF priority for the port during the election process for the designated router. The port with the highest priority number is the best candidate for the designated router. If you set the priority to 0, the port cannot become either the designated router or a backup designated router. The default is 1.

retransmit-interval <0-3600>

Configures the retransmit interval: the number of seconds between LSA retransmissions.

transit-delay <0-3600>

Configures the transit delay: the estimated number of seconds it takes to transmit a link-state update over the interface.