The ospf network-type command sets a network type for an 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 interfaces is broadcast.
ospf network-type { broadcast | nbma | p2mp | p2p [ peer-ip-ignore ] }
undo ospf network-type
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 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, neighbor relationships do not need to be configured.
The condition for changing an NBMA network to broadcast network is that there must be a direct virtual circuit between any two devices, and the network must 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 device directly connected to the two 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 a 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.
If the network type of an OSPF interface is NBMA, OSPF does not advertise the interface's information to RSVP-TE, and TE tunnels passing through this interface fail to go Up.
Generally, the network type of two OSPF interfaces on both ends of the link must be identical. Otherwise, the two interfaces cannot set up the neighbor relationship.
Only when the network type of one OSPF interface is broadcast and the network type of the other OSPF interface is P2P or P2MP, the two interfaces can still set up the neighbor relationship, but cannot learn the OSPF routing information each other.
# Set network type of VLANIF100 to NBMA.
<HUAWEI> system-view
[HUAWEI] interface vlanif 100
[HUAWEI-Vlanif100] ospf network-type nbma
# Set network type of GE0/0/1 to NBMA.
<HUAWEI> system-view [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] undo portswitch [HUAWEI-GigabitEthernet0/0/1] ospf network-type nbma