Help Center Help Articles Professional Support Professional Integrators Community RMA & Warranty Downloads Tech Specs

UniFi Gateway - OSPF (Advanced)

OSPF is a dynamic routing protocol that automatically maps optimal routing paths without manually configuring static routes on every network gateway. This optimizes efficiency and provides resiliency in the case of one particular path experiencing failure. 

Note: Our Site Magic SD-WAN uses OSPF to automatically optimize routing between Site-to-Site VPNs across multiple UniFi Gateways without additional configuration.

Requirements

How does it work?

OSPF is enabled on different interfaces of the UniFi Gateway and automatically sets up neighbor connections (adjacencies) with other gateways on these networks. After establishing a neighborship, routes are exchanged between the gateways.

OSPF Settings

OSPF is enabled by creating one or more OSPF areas and associating interfaces (networks) to these areas. The UniFi Network Application automatically enables OSPF on the interfaces which allows it to form neighborship connections and also advertises the subnet into OSPF. The following options can be selected:

  • Area ID - Enter 0.0.0.0 for the backbone area.
  • Area Type - Select a Normal, NSSA or Stub area. Default is Normal.
  • Interface - Select one or more interfaces (networks) that OSPF should be enabled on.

After an interface is created, it can be edited and the following options can be changed:

  • Cost - This is the OSPF path cost. Default is 1.
  • AuthenticationAuthenticate the neighbor connection with plain text or MD5. Default is off.
  • Hello Interval -  Time between OSPF hello messages. Default is 10.
  • Dead Interval - Time before an OSPF neighbor is considered down. Default is 40.
  • Passive Interface - The networks associated with passive interfaces are advertised into OSPF, but do not form adjacencies with other OSPF gateways.

Optionally, configure the following options:

  • Router ID - Uniquely identifies the UniFi Gateway and must be unique between neighbors. The Router ID is automatically generated but can be customized if needed.
  • Redistribute Connected Routes - Advertise connected routes (local networks) into OSPF.
  • Redistribute Static Routes - Advertise static routes into OSPF.

To establish an OSPF neighbor connection, the following parameters need to match between the gateways or the adjacency will not form:

  • Hello Interval
  • Dead Interval
  • Area ID
  • Subnet Mask / Prefix
  • Area Type
  • Authentication. When using MD5, ensure that both the Key ID and Key match.
  • Network Type
  • MTU. Generally this will be 1500.

In addition, the interface must not be passive and the Router ID must be unique. For example, two OSPF neighbors cannot both use 192.168.1.1 as the Router ID. 

Was this article helpful?