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 is p2p, and Frame-relay interface is nbma.
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 unnumbering 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
With the link layer protocol unchanged, you can flexibly construct an OSPF network by changing the network type and configuring features.
On a broadcast network, if a router that does not support the multicast address exists, you can change the network type of the interface to NBMA.
If the network type of the interface is NBMA, the neighboring router is not needed when the interface type is changed to broadcast.
To change an NBMA network to a broadcast network, there should be a direct virtual circuit between any two routers, or the network should be a full mesh network. If the preceding condition is not met, you can change the network type to P2MP. In this case, two indirectly connected routers can exchange routing information through one or two direct and reachable routers. After the network type of the interface changes to P2PM, neighboring routers do not need to be configured.
If there are only two routers that run OSPF in the one network segment, you can also change the network type to P2MP.
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 adjacent point.
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, the two interfaces can still set up the neighbor relationship. but cannot learn the OSPF routing information each other.