OSPF

OSPF is a vendor neutral open standard.

It establishes adjacencies and passes link state advertisements with other routers in an area.

Creates a link state database from the LSA's it receives.

Will choose what it believes to be the best path and injects it into the routing table.


LSA's

LSA is the information that a packet called an LSU (Link State Update) sends and receives.

Hello is used to discover OSPF neighbors and confirm reachability. It is used in election processes as well.

Link State Request is used to get specific information from a neighbor.

Link State Acknowledgement is used to confirm it received an LSU


Neighbors/Adjacencies

Neighbors exchange information and hello messages.

Adjacencies are neighbors but they exchange link state updates and database description (DD) packets.

To form a neighborship the following requirements must be met:

Matching area, authentication, subnet, timers, and stub flags.


LSA Types

Type 1: Router LSA contains information on directly attached networks.

Type 2: Network LSA is made for each transit network inside an area which a DR is elected.

Type 3: Summary LSA is sent from one area to another and is used to advertise a network in the source area.

Type 4: Summary ASBR LSA is created by an ABR to tell members of an area how to reach an ASBR

Type 5: AS External LSA is created by an ASBR to advertise networks imported from a different AS.

Type 6: OSPF Group LSA(Multicast) use PIM instead.

Type 7: NSSA SLA is sent from an ASBR into an NSSA to advertise networks from a different AS.

Type 8: OSPF external attributes and link local LSA (OSPFv3) used to carry BGP through OSPFv2. Sends IPv6 through OSPFv3.

Type 9: OSPF link scope opaque(v2) and intra-area prefix(v3), used to carry additional info with v2 and address info/network adverts in v3.

Type 10: Area scope opaque used to send additional info such as MPLS TE info.

Type 11: Same as Type 10 but not flooded into stubs.


Network Types and Elections

Point to point



Between two devices.

No DR/BDR election

Default hello: 10s

Default dead: 40s


Broadcast



Connected with a broadcast-capable medium.

Scalable

DR/BDR election

Default hello: 10s

Default dead: 40s


NBMA



Non-Broadcast Multiaccess

Devices are configured with the ip of each neighbor and hello packets are transmitted in unicast.

DR/BDR election but make non DR device priority 0

Default hello: 30s

Default dead: 120s

Point to multipoint



Treats the links as point to point

No DR/BDR election

Links can use the same subnet

Default hello: 30s

Default dead: 120s


Areas

Metrics

Configuration


Network advertisements are done with wild card masks, and it does not explicitly advertise networks like BGP. It advertises that network if it has an interface that is configured for that network.

OSPF is configured in router configuration mode.

It requires a process ID. This ID is not required to be the same on each routing instance and is only locally important. Multiple routing instances (multiple OSPF processes with separate IDs) can run on the same router.

(conf)#router ospf "process id(positive integer)"

(config-router)#network "network address" "wildcard mask" area "area
 id"

Passive interfaces are configured on interfaces that you do not want to participate in OSPF such as links to local networks you may be advertising and do not want LSAs sent through.

config-router)#passive-interface "interface"

Auto-cost reference-bandwidth is configured in Mb/s. For reference 1Gb/s is 100000. This must be set on all routers within area to function properly.

Reference bandwidth can be changed with the following.

(config-router)#auto-cost reference-bandwidth "100000"

Utility Commands

#show ip ospf database

Shows OSPF link state and LSA data.

NX-OS (Nexus) Configuration

On nexus devices you configure OSPF under the interfaces themselves instead of a network command under the OSPF process. On nexus devices you also have to turn on most features before use.


We will need to enable the OSPF feature.

(config)#feature ospf

We can then create the OSPF process and then add the interfaces to it.

(config)# router ospf "id"

(config-router)# default-information originate

Adding the interfaces. If it is not configured with "no switchport" you will want to do that as well as any other configurations such as IP.

(config)#int "int"

(config-if)# no switchport

(config-if)# ip address "address/cidr"

(config-if)# ip ospf network "network type(point-to-point etc)"

(config-if)# ip route ospf "id" area "area 0.0.0.0"

(config-if)# no shut

This adds the interface to the ospf process.

If you want this to be advertised but not advertised over, you can make it a passive interface. This needs to be done on the interface, physical or vlan.

(config-if)# ip ospf passive-interface


Unnumbered

OSPF can use loopback interfaces to advertise and form adjacencies while not having a network setup on the interfaces themselves. In most cases it's actually more like the interface is using the loopback IP as an alias for it's IP and you are telling that interface to have ospf enabled but logically we see this as OSPF doing it.

The interface that supplies the ip is the 'numbered interface', interfaces that use a numbered interface for an alias are 'unnumbered'. You can use multiple numbered interfaces but in this case we will not be doing that. In more advanced topologies like with eBGP and VXLAN (EVPN?) this may be more useful.


Configuration

We will turn on the OSPF feature, start OSPF in named mode with the name 'TEST' and enable adjacency logging.

(config)# feature ospf

(config)# router ospf TEST

(config)# log-adjacency-changes


Next is to configure the loopback interface we want to use with the unnumbered configuration. We will tell unnumbered interfaces to use this as there numbered interface.

(config)# int lo0

(config-if)# ip address 10.10.0.0/31


Now we can enable the switchport that goes to our neighbor. This includes setting the interface to p2p and telling it to use loopback as the 'numbered' interface.

(config)# int e1/1

(config-if)# no switchport

(config-if)# medium p2p

(config-if)# ip unnumbered loopback0

(config-if)# ip router ospf TEST area 0.0.0.0

(config-if)# no shut


We will create a second loopback interface to be advertised for additional testing.

(config)# int lo0

(config-if)# ip address 172.16.0.1/24

(config-if)# ip router ospf TEST area 0.0.0.0


When we do a show ip route we should see our networks. Notice we didn't add our lo0 that we used as our numbered interface as we did not advertise it.



Popular posts from this blog