Arista EOS OSPF Configuration and Verification - 夜莺博客

Arista EOS OSPF Configuration and Verification

Arista EOS gives you two ways to put an interface into an OSPF area — a network statement in router configuration, or an ip ospf line on the interface itself — and mixing them in one network is the fastest way to lose an adjacency. This article covers both styles, the interface parameters that must match between neighbours, and the verification sequence that goes from adjacency to installed route.

Two configuration styles

! Style 1 - network statements
switch(config)# router ospf 1
switch(config-router-ospf)# router-id 10.0.0.1
switch(config-router-ospf)# network 10.0.10.0/24 area 0.0.0.0
switch(config-router-ospf)# network 10.0.20.0/24 area 0.0.0.1
switch(config-router-ospf)# passive-interface default
switch(config-router-ospf)# no passive-interface Ethernet1
switch(config-router-ospf)# max-lsa 12000

! Style 2 - per-interface assignment (preferred in modern EOS)
switch(config)# interface Ethernet1
switch(config-if-Et1)# ip ospf 1 area 0.0.0.0
switch(config-if-Et1)# ip ospf cost 10
switch(config-if-Et1)# no shutdown

Per-interface configuration is the more maintainable choice because the area a port belongs to is visible when you inspect the port, and because it removes the need to reason about which interface a wildcard network statement happens to match. EOS also supports multiple OSPF instances, so the process number has to be repeated on the interface line.

Neighbour parameters that must match

interface Ethernet1
 ip ospf network point-to-point
 ip ospf hello-interval 3
 ip ospf dead-interval 12
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 SecretKey
 ip ospf bfd
 ip ospf mtu-ignore            ! only for genuine MTU mismatches - understand why first

Hello and dead intervals, area ID, network type and authentication must match on both ends for the adjacency to leave INIT. A mismatch is silent in the routing table and obvious in the adjacency state — which is why show ip ospf neighbor is always the first command.

Verification

switch# show ip ospf neighbor
! Neighbor ID     VRF      Pri   State        Dead Time   Address       Interface
! 10.0.0.2        default  1     FULL/BDR     00:00:35    10.17.254.2   Ethernet1

switch# show ip ospf neighbor state full        ! only fully adjacent neighbours
switch# show ip ospf interface brief
switch# show ip ospf interface Ethernet1        ! timers, cost, area, DR role
switch# show ip ospf database                   ! LSDB summary by LSA type
switch# show ip ospf 1 database router          ! detailed router LSAs
switch# show ip route ospf                      ! what got installed
show ip ospf 1                                  ! process-level: areas, SPF stats

Reading the state column correctly matters: FULL is healthy, 2WAY is normal between non-DR routers on a broadcast segment, and anything stuck at INIT or EXSTART is a mismatch (timers, MTU or authentication) rather than a reachability problem. For the INIT case specifically, see OSPF neighbour stuck in INIT.

Redistribution and VRF interaction

switch(config)# router ospf 1
switch(config-router-ospf)# redistribute connected
switch(config-router-ospf)# redistribute static route-map STATIC-TO-OSPF
switch(config-router-ospf)# default-information originate

! OSPF inside a VRF
switch(config)# router ospf 2 vrf Blue
switch(config-router-ospf)# network 10.20.0.0/16 area 0.0.0.0

OSPF is per-VRF, so a tenant VRF needs its own process. Route leaking between VRFs is not an OSPF function — it happens in BGP or through explicit interface-based designs, covered in Arista EOS VRF configuration and route leaking.

Symptoms and causes

  • Adjacency flapping every 40 seconds — dead interval expiry because the transport is not actually passing hellos (a unidirectional link, or an intermediate device filtering multicast).
  • FULL but no routes from that neighbour — the neighbour is a stub with no prefixes, or its LSAs are being filtered. Check show ip ospf database for the expected LSA types.
  • Two neighbours, only one route path — equal-cost multipath not enabled, or costs differ. show ip route 10.0.0.0/8 shows the ECMP set.
  • Inter-area routes missing — an area that is not directly attached to area 0 and has no virtual link. See OSPF LSA types and scopes for the topology rules behind it.
  • max-lsa warning messages — the LSDB limit has been crossed; the process logs it rather than failing silently, so read the log rather than assuming OSPF is healthy.

For the multicast and route types that underpin what you see here, OSPF stub and NSSA area types covers the design options, and NX-OS OSPF examples is the closest cross-platform comparison for anyone running mixed data centres.

原文链接:https://www.arista.com/en/um-eos/eos-open-shortest-path-first-version-2