Skip to main content
  1. Router and Switch Articles/
  2. IOS-XR/

IOS XR OSPF Network Type Configuration

Table of Contents

How to Configure the OSPF Network Type on Cisco IOS XR

This is the command for changing the OSPF network type on Cisco IOS XR. You specify it in the interface submode under router ospf. For how the types differ in behaviour, see OSPF Network Types.

IOS XR OSPF Network Type Configuration
router ospf [PROCESS_NAME]
 area [AREA_ID]
  interface [INTERFACE_NAME]
   network [TYPE]
  !
 !
!
FieldValue
[TYPE]One of broadcast, point-to-point, non-broadcast, point-to-multipoint

Ethernet interfaces default to broadcast. When left at the default, no network line appears in show running-config.

TypeHello / DeadDR/BDRNeighbor discovery
broadcast10 / 40 sElectedAutomatic (224.0.0.5)
point-to-point10 / 40 sNot electedAutomatic (224.0.0.5)
non-broadcast30 / 120 sElectedManual (neighbor required)
point-to-multipoint30 / 120 sNot electedAutomatic (224.0.0.5)

The Hello and Dead intervals have to match at both ends of a link. Changing the type also changes those defaults, so changing only one end prevents the adjacency from coming up. Configure both ends the same way.

Non-Broadcast Requires Neighbors to Be Specified Manually

non-broadcast cannot discover neighbors by multicast, so you name the remote address with the neighbor command.

IOS XR OSPF Non-Broadcast Neighbor Configuration
router ospf [PROCESS_NAME]
 area [AREA_ID]
  interface [INTERFACE_NAME]
   network non-broadcast
   neighbor [NEIGHBOR_IP_ADDRESS]
  !
 !
!

Setting the Hello and Dead Intervals Explicitly

You can also set them explicitly instead of relying on the default for the type.

IOS XR OSPF Hello / Dead Interval Configuration
router ospf [PROCESS_NAME]
 area [AREA_ID]
  interface [INTERFACE_NAME]
   hello-interval [SECONDS]
   dead-interval [SECONDS]
  !
 !
!
On IOS XE you write ip ospf network <type> under interface. The type names are the same, but IOS XR differs in that the setting lives in the hierarchy under router ospf.

Cisco IOS XR Network Type Verification Commands

CommandWhat it shows
show ospf interface [INTERFACE_NAME]The Network Type, the Hello / Dead intervals, and whether there is a DR/BDR
show ospf interface briefThe state of each interface. Types that do not elect a DR/BDR appear as P2P
show ospf neighborThe neighbor state. Point-to-point carries no DR/BDR role
show ospf databaseWhether a Network-LSA (Type 2) exists. Types that do not elect a DR/BDR do not create one
show ospf database routerThe link type in the Router-LSA (Transit or point-to-point)
show running-config router ospfThe configured network type

Verification on Real Devices

We connected three routers, XR1 to XR3, in a line and changed the network type on the XR1-XR2 link. The XR2-XR3 link was left at the default of broadcast so that both types can be compared on the same device.

LinkNetwork type
XR1-XR2 (10.1.2.0/24)point-to-point (configured at both ends)
XR2-XR3 (10.2.3.0/24)The default, broadcast

Configuring the Network Type

XR1 OSPF Configuration
router ospf 1
 router-id 1.1.1.1
 area 0
  interface Loopback0
   passive enable
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
  !
 !
!
XR2 OSPF Configuration
router ospf 1
 router-id 2.2.2.2
 area 0
  interface Loopback0
   passive enable
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
  !
  interface GigabitEthernet0/0/0/1
  !
 !
!
XR3 OSPF Configuration
router ospf 1
 router-id 3.3.3.3
 area 0
  interface Loopback0
   passive enable
  !
  interface GigabitEthernet0/0/0/0
  !
 !
!

network point-to-point is applied only to GigabitEthernet0/0/0/0 on XR1 and XR2, which is the XR1-XR2 link. GigabitEthernet0/0/0/1 on XR2, facing XR3, stays at the default of broadcast.

Here is the configuration being entered on XR1.

XR1 Network Type Configuration Example
RP/0/RP0/CPU0:XR1#configure
Thu Sep 10 07:51:14.373 UTC
RP/0/RP0/CPU0:XR1(config)#router ospf 1
RP/0/RP0/CPU0:XR1(config-ospf)#router-id 1.1.1.1
RP/0/RP0/CPU0:XR1(config-ospf)#area 0
RP/0/RP0/CPU0:XR1(config-ospf-ar)#interface Loopback0
RP/0/RP0/CPU0:XR1(config-ospf-ar-if)#passive enable
RP/0/RP0/CPU0:XR1(config-ospf-ar-if)#exit
RP/0/RP0/CPU0:XR1(config-ospf-ar)#interface GigabitEthernet0/0/0/0
RP/0/RP0/CPU0:XR1(config-ospf-ar-if)#network point-to-point
RP/0/RP0/CPU0:XR1(config-ospf-ar-if)#exit
RP/0/RP0/CPU0:XR1(config-ospf-ar)#commit
Thu Sep 10 07:51:15.532 UTC
RP/0/RP0/CPU0:XR1(config-ospf-ar)#end
RP/0/RP0/CPU0:XR1#show running-config router ospf
Thu Sep 10 07:51:17.979 UTC
router ospf 1
 router-id 1.1.1.1
 area 0
  interface Loopback0
   passive enable
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
  !
 !
!

Verifying the Configuration

Running show ospf interface brief on XR2 in the middle puts both types on one screen. Gi0/0/0/0, set to point-to-point, shows P2P in the State column and carries no DR/BDR role. Gi0/0/0/1, left at broadcast, shows BDR.

XR2 show ospf interface brief
RP/0/RP0/CPU0:XR2#show ospf interface brief
Thu Sep 10 07:53:04.287 UTC

* Indicates MADJ interface, (P) Indicates fast detect hold down state

Interfaces for OSPF 1

Interface          PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo0                1     0               2.2.2.2/32         1     LOOP  0/0
Gi0/0/0/0          1     0               10.1.2.2/24        1     P2P   1/1
Gi0/0/0/1          1     0               10.2.3.2/24        1     BDR   1/1

show ospf interface shows the details of the point-to-point side. It reports Network Type POINT_TO_POINT, and the lines that would name the DR and BDR are absent entirely. The Hello and Dead intervals are 10 and 40 seconds, the same defaults as broadcast.

XR1 show ospf interface GigabitEthernet0/0/0/0
RP/0/RP0/CPU0:XR1#show ospf interface GigabitEthernet0/0/0/0
Thu Sep 10 07:53:45.375 UTC

GigabitEthernet0/0/0/0 is up, line protocol is up 
  Internet Address 10.1.2.1/24, Area 0, SID 0, Strict-SPF SID 0
  Label stack Primary label 0 Backup label 0 SRTE label 0
  Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 1
  Transmit Delay is 1 sec, State POINT_TO_POINT, MTU 1500, MaxPktSz 1500
  Forward reference No, Unnumbered no,  Bandwidth 1000000 
  RIB LC sync Yes
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:03:298
  Index 2/2, flood queue length 0
  Next 0(0)/0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  LS Ack List: current length 0, high water mark 3
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 2.2.2.2
  Suppress hello for 0 neighbor(s)
  Multi-area interface Count is 0
  Segment Routing Forwarding MPLS enabled: Yes
  Adjacency hold timer expired last : Never
  Exchange timer expired last : Never

The State column of show ospf neighbor differs too. The point-to-point side shows FULL/ - with an empty role, while the broadcast side shows FULL/DR.

XR2 show ospf neighbor
RP/0/RP0/CPU0:XR2#show ospf neighbor
Thu Sep 10 07:53:04.833 UTC

* Indicates MADJ interface
# Indicates Neighbor awaiting BFD session up

Neighbors for OSPF 1

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1         1     FULL/  -        00:00:35    10.1.2.1        GigabitEthernet0/0/0/0
    Neighbor is up for 00:01:28
3.3.3.3         1     FULL/DR         00:00:35    10.2.3.3        GigabitEthernet0/0/0/1
    Neighbor is up for 00:01:10

Total neighbor count: 2

It also shows up in the LSDB. There is only one Network-LSA (Net Link States), on the broadcast side; none is created for the point-to-point link. On types that do not elect a DR/BDR, the link is advertised inside the Router-LSA as another Router (point-to-point) instead.

XR2 show ospf database
RP/0/RP0/CPU0:XR2#show ospf database
Thu Sep 10 07:53:06.024 UTC


            OSPF Router with ID (2.2.2.2) (Process ID 1)

		Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         90          0x80000002 0x006d74 3
2.2.2.2         2.2.2.2         40          0x80000003 0x000e96 4
3.3.3.3         3.3.3.3         41          0x80000002 0x0006d2 2

		Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.2.3.3        3.3.3.3         41          0x80000001 0x0046c1

Test Configuration and show Output

The following three kinds of output were collected from all three routers, split per router. The test configuration is these ..._run.txt files.

FileContents
..._show.txtshow version / show interface description / show route / show route ospf / show ospf / show ospf interface / show ospf interface brief / show ospf neighbor / show ospf neighbor detail / show ospf database / show ospf database router / show ospf database network / show ospf statistics interface / show ospf routes / show router-id / show ospf trace events
..._log.txtshow logging, taken by inserting a marker with logmsg just before configuring OSPF and passing its timestamp to show logging start
..._run.txtshow running-config (that is, the test configuration)
Routershow outputsyslogrunning-config
XR1showlogrun
XR2showlogrun
XR3showlogrun

The Router-LSA link types can be checked in show ospf database router inside ..._show.txt. The point-to-point link is advertised as another Router (point-to-point).

Related Articles

For how the network types differ, see OSPF Network Types; for DR/BDR election, see OSPF DR and BDR; for basic OSPF configuration, see IOS XR OSPF Basic Configuration.