ospf network-type
Function
The ospf network-type command sets the network type of the OSPF interface.
The undo ospf network-type command restores the default network type of the OSPF interface.
By default, the network type of an interface is determined by the physical interface. The network type of Ethernet interface is broadcast, that of the serial interface (encapsulated with PPP or HDLC) is p2p, and that of Frame-relay interface is nbma.
Format
ospf network-type { broadcast | nbma | p2mp | p2p [ peer-ip-ignore ] }
undo ospf network-type
Parameters
Parameter | Description | Value |
---|---|---|
broadcast | Indicates that the network type of the interface is changed to broadcast. | - |
nbma | Indicates that the network type of the interface is changed to NBMA. | - |
p2mp | Indicates that the network type of the interface is changed to point-to-multipoint. | - |
p2p | Indicates that the network type of the interface is changed to point-to-point. | - |
peer-ip-ignore | Disables network segment check when IP address unnumbered is not configured for a P2P interface changed from a broadcast interface and the interface tries to establish an OSPF neighbor relationship. By default, if peer-ip-ignore is not specified in the command, OSPF checks the network segment of the two ends during which an OSPF neighbor relationship is to be established. Specifically, OSPF performs an AND operation on the local subnet mask and the local IP address and on the local subnet mask and the remote IP address. An OSPF neighbor relationship can be established only when the results on the two ends are the same. |
- |
Usage Guidelines
Usage Scenario
When link layer protocols remain unchanged, you can change network types and configure OSPF features to flexibly build networks.
In the broadcast network, if there is a device that does not support multicast address, you can change the network type of the interface to NBMA.
If the network type of the interface is NBMA, when the interface type is changed to broadcast, the neighboring device is not needed.
The condition for changing a NBMA network to broadcast network is that there should be a direct virtual circuit between any two devices. The network should be a full mesh network. If a network does not meet the preceding conditions, you must change the type of network to point-to-multipoint. In this manner, two indirect devices can communicate with the help of one or two direct and reachable devices. Instead of configuring the neighboring device, you can change the network type of the interface to point-to-multipoint.
If there are only two devices that run OSPF in the same network segment, the network type of an interface can be changed to p2p.
Precautions
OSPF does not support the configuration on the Null interface.
When the network type of an interface is NBMA, or the network type of an interface is changed to NBMA manually, you must run the peer command to configure the neighbor.
Generally, the network types of two OSPF interfaces on the both ends of the link must be identical. Otherwise, the two interfaces cannot set up the neighbor relationship.
When the network type of one OSPF interface is broadcast and the network type of the other OSPF interface is P2P, the two interfaces can still set up the neighbor relationship, but cannot learn the OSPF routing information each other.
- When the network types of OSPF interfaces on both ends of a link are P2MP and P2P, the two OSPF interfaces can establish OSPF neighbor relationship but cannot learn routing information from each other. To enable the interfaces to learn routing information from each other, configure the same interval for sending Hello packets and same neighbor holdtime on the two OSPF interfaces.