OSPF
Areas and LSAs
OSPF is enabled per area per interface: set protocols ospf area 0.0.0.0 interface ge-0/0/0.0. Every router in an area builds an identical link-state database from type 1 (router) and type 2 (network, from the DR) LSAs. ABRs inject type 3 summaries between areas; ASBRs inject type 5 externals; type 4 tells other areas how to reach an ASBR; type 7 appears only inside an NSSA and is translated to type 5 by the ABR. Type 3, 4, and 5 do not exist within a totally stubby area.
Timers and election
Broadcast and point-to-point interfaces use hello 10 and dead 40 (dead defaults to four times hello); NBMA and point-to-multipoint use 30/120. DR election uses interface priority (default 128; 0 means never DR), then router ID. The election is not preemptive: a new router with a higher priority does not displace the existing DR.
Area types and externals
A stub area blocks type 5 and gets a default from the ABR; adding no-summaries makes it totally stubby. An NSSA blocks type 5 but permits type 7 for externals originated inside. Redistribution requires an export policy matching the source protocol, and the route must be active in the routing table. default-information originate injects a default only if one exists locally - add always to force it.
Traps
- Type 2 externals keep their original metric; type 1 externals add the internal cost to reach the ASBR.
- Cost is reference bandwidth divided by interface bandwidth (reference defaults to 100 Mbps), so a 10 Mbps link costs 10; change the reference consistently across the area.
- Virtual links must transit area 0 and are configured on both endpoints.
Worked example
Reference bandwidth 100 Mbps: a 1 Gbps link costs 1 and a 10 Mbps link costs 10. Three 10 Mbps hops therefore cost 30 end to end.