Mate's CCNA Notes

Home

❯

CCNA

❯

Days

❯

Day 28 OSPF (3

Day 28 - OSPF (3)28. Nap - OSPF (3)

May 26, 20256 min read

  • ccna/days

Jeremy’s IT Lab lecture video:

Day 28 - OSPF (3)


Commands

Commands List

Router Show Commands

8. Routes

8.1 General

  • show ip route [argument] --> Shows the router/switch’s routing table, optionally with an argument to filter for routes of a specific type
    • show ip protocols --> Shows routing protocol information

8.2 EIGRP Routes

  • show ip eigrp neighbors --> Shows information about EIGRP neighbors
  • show ip eigrp topology --> Shows all learned routes through EIGRP and their information. Includes routes that aren’t currently displayed in show ip route, and shows the EIGRP Feasible Distance and Reported Distance

8.3 OSPF Routes

  • show ip ospf database --> Shows all of the Link State Advertisements (LSA) in the Link State Database (LSDB)
  • show ip ospf neighbor --> Shows the router’s OSPF neighbors
  • show ip ospf interface [interface-id] --> Shows detailed information about all the interfaces running OSPF, or one specific interface if specified
    • show ip ospf interface brief --> Brief view of all OSPF interfaces
Link to original

Router Global Configuration Commands

Router Commands

General

  • router routing-protocol
  • network arguments --> Enables the routing protocol on interfaces within that IP range
  • passive-interface interface-id --> Turns the interface into a passive interface that doesn’t send out protocol advertisements. The router will still continue to advertise the network prefix of the interface
  • passive-interface default --> Enables the Passive Interface mode on all interfaces by default
  • default-information originate --> Advertises the default route to all other neighbors
  • no router-id --> Resets the current Router ID on the router.
  • distance distance-value --> Changes the administrative distance (AD) of the routing protocol
  • maximum-paths path-value --> Changes the maximum amount of paths that Equal Cost Multi-Path (ECMP) can be done over

RIP

  • router rip --> Goes into RIP configuration mode
  • version 2 --> Switches RIP version to 2
  • no auto-summary --> Disables auto-summarization to stop routers from converting advertised classless addresses into classful addresses
  • network ip-address --> Enables RIP on all interfaces that are within the IP range

EIGRP

  • router eigrp autonomous-system-number --> Goes into EIGRP configuration mode in the specified autonomous system group
  • eigrp router-id a.b.c.d --> Changes the EIGRP router ID
  • no auto-summary --> Disables auto-summarization to stop routers from converting advertised classless addresses into classful addresses
  • network ip-address [wildcard-mask] --> Enables EIGRP on interfaces within the specified range. A wildcard mask can be used optionally

OSPF

  • router ospf process-id --> Goes into OSPF router configuration for the specified process
  • router-id a.b.c.d --> Changes the OSPF router ID
  • network ip-address wildcard-mask area area-number --> Enables OSPF on interfaces within the specified range and puts them in the specified area number.
  • auto-cost reference-bandwidth megabits-per-second --> Changes the default reference bandwidth that is used for calculating the metric/cost
  • shutdown --> Shuts down the current OSPF process when in OSPF process configuration mode

Link to original

2. OSPF

  • clear ip ospf process --> Restarts the current OSPF process
Link to original

OSPF Interface Commands

1. OSPF

  • ip ospf cost cost --> Changes the interface’s cost value
  • ip ospf process-ID area area --> Enables OSPF directly on an interface
  • ip ospf priority priority --> Changes the interface’s OSPF priority, used for DR/BDR elections
  • ip ospf network network-type { broadcast / point-to-point / non-broadcast } --> Changes the OSPF network type used on the interface
  • ip ospf hello-interval seconds --> Changes the Hello message timer
  • ip ospf dead-interval seconds --> Changes the Dead message timer
  • ip ospf authentication --> Enables OSPF authentication on the current interface
  • ip ospf authentication-key password --> Sets the authentication key/password on the interface
Link to original

Serial

  • interface serial port/number --> Enters serial interface configuration mode
    • clock rate bits-per-second --> Changes the serial interface’s operating speed, used on the DCE (Data Communications Equipment) side
    • encapsulation protocol {ppp / hdlc} --> Changes the encapsulation mode. Must match on both sides of the serial connection
Link to original


OSPF Information

Loopback Interfaces

A loopback interface is a virtual interface in the router that’s always in an up/up state (unless shutdown).

  • It does not depend on a physical interface, therefore, it provides a consistent IP address that can be used to reach the router or identify it.

OSPF Network Types

OSPF has a few network types that are used for different scenarios and behave differently. The 3 main ones are:

  1. Broadcast
    • Enabled by default on Ethernet and FDDI (Fiber Distributed Data Interface) interfaces.
  2. Point-to-point
    • Enabled by default on PPP (Point-to-Point Protocol) and HDLC (High-Level Data Link Control).
  3. Non-broadcast
    • Enabled by default on Frame Relay and X.25 interfaces.

How to change the network type on an interface?

The OSPF network type can be configured on an interface with the ip ospf network NETWORK-TYPE command

Network Type Table Summary

BroadcastPoint-to-pointNon-broadcast
Default on Ethernet and FDDIDefault on PPP and HDLCDefault on Frame Relay and X.25
DR/BDR electedNo DR/BDR electedNo DR/BDR elected
Neighbors dynamically discoveredNeighbors dynamically discoveredNeighbors aren't dynamically discovered
Default timers:
Hello - 10 seconds
Dead - 40 seconds
Default timers:
Hello - 10 seconds
Dead - 40 seconds
Default timers:
Hello - 30 seconds
Dead - 120 seconds

Broadcast Network Type

The broadcast network type is enabled by default on Ethernet and FDDI (Fiber Distributed Data Interface) interfaces.

  • Routers dynamically discover neighbors by sending and receiving OSPF Hello messages using the multicast address of 224.0.0.5
  • A DR (Designated Router) and BDR (Backup Designated Router) must be elected on each subnet. (With there only being a DR if there are no OSPF neighbors)
    • Any other routers in the network which aren’t DRs or BDRs will become DROthers.
    • Messages to the DR/BDR are sent to the multicast address of 224.0.0.6

Important DR/BDR and DROthers info

  • Routers will only form a FULL OSPF adjacency with the DR and BDR of the segment. Therefore, routers only exchange LSAs with the DR and BDR.
  • Meanwhile, the DROthers establish a 2-way connection between each other, and do not share LSAs with each other. (All routers will still have the same LSDB, but this reduces the amount of LSAs flooding the network.)

  • In short,
    • the DR and BDR will form a FULL OSPF adjacency with ALL routers in the subnet.
    • DROthers will form a FULL OSPF adjacency only with the DR/BDR

DR and BDR Election

There are two values that are checked when electing a DR and BDR, with the order of priority being from top to bottom

  1. Highest OSPF interface priority
  2. Highest OSPF Router ID

The first place is assigned the DR role for the subnet, the second place is assigned the BDR role. All other routers in the subnet will become DROthers.

  • The DR/BDR election is ‘non-preemptive’, meaning that once both the DR and BDR are selected, they will keep their role until the OSPF process is reset, or the interface is shutdown/fails, etc.
    • If the OSPF process is reset or the DR/BDR interface is down for whatever reason, the BDR will instantly assume the role of DR and a new BDR election will be held, even if there are currently interfaces with higher priorities or Router IDs.

OSPF Interface Priority

The default OSPF interface priority is 1 on all interfaces.
If the OSPF interface priority is set to 0, the router cannot become a DR or BDR for the subnet.

The priority can be changed on a per-interface basis with a maximum value of 255 using the command:
ip ospf priority PRIORITY-VALUE


Point-to-Point Network Type

The Point-to-Point network type is enabled by default on PPP (Point-to-Point Protocol) and HDLC (High-Level Data Link Control).

  • Routers dynamically discover neighbors by sending and receiving OSPF Hello messages using the multicast address of 224.0.0.5
  • There are no DR/BDR elections, as this connection type is used between two devices (aka point-to-point), so there would be no need to elect a DR or BDR.

Serial Interfaces

Serial interfaces are old interfaces that were used before the invention of Ethernet interfaces.

  • It consists of two connections with one side functioning as the DCE (Data Communications Equipment) and the other functioning as the DTE (Data Terminal Equipment).
  • The DCE side of the connection is the one responsible for the clock rate (speed) of the connection.
  • The default encapsulation on a serial interface is HDLC. (cHDLC for Cisco devices)
    • The encapsulation type must match on both sides of the connection, or else, both interfaces will go down won’t be able to communicate with each other.

Clock rate VS. Speed

Ethernet interfaces use the speed MEGABITS-PER-SECOND command to configure their interfaces’ working speed.
Meanwhile, Serial interfaces use the clock rate BITS-PER-SECOND command

How to figure out which side is DCE and which is DTE?

You can check which side is DCE and DTE with the show controllers serial INTERFACE-ID command. Where INTERFACE-ID is the ID of the serial interface you’re checking.


OSPF Neighbor Requirements

For OSPF routers to become neighbors, there are multiple requirements they should meet. The most important ones are:

  1. OSPF process must not be shutdown
  2. Interfaces must be in the same subnet
  3. Area number must match
  4. OSPF Router IDs must be unique
  5. Hello and Dead timers must match
  6. Authentication settings must match
  7. IP MTU settings must match
  8. OSPF Network Type must match

IP MTU and Network Type disclaimer

For #7 (IP MTU settings must match) and #8 (OSPF Network Type must match), routers can become OSPF neighbors with each other, however, they will not operate properly.

  • So, if you check the OSPF show commands and everything looks fine but the system isn’t functioning correctly, make sure to check on #7 and #8

OSPF LSA Types

The OSPF LSDB contains a list of LSAs, and, there are 11 different types of LSAs that can be contained within that database. The most important three for the CCNA are:

  1. Type 1 (Router LSA)
    • Every OSPF router generates this LSA.
    • It identifies the router using the Router ID.
    • It lists the networks attached to the router’s OSPF-activated interfaces.
  2. Type 2 (Network LSA)
    • Generated by the DR of each multi-access network (like the broadcast network type)
    • Lists the routers which are attached to the multi-access network.
  3. Type 5 (AS-External LSA)
    • Generated by the ASBRs to describe routes to destinations outside of the AS (OSPF domain)

Jeremy’s IT Lab előadásvideó:

28. Nap - OSPF (3)


Parancsok

Parancslista

Router Show Parancsok

8. Útvonalak

8.1 Általános

  • show ip route [argument] --> Megjeleníti a router/switch routing table-jét, opcionális argumentummal szűrve egy adott útvonaltípusra
  • show ip protocols --> Megjeleníti az útválasztó protokoll információit

8.2 EIGRP Útvonalak

  • show ip eigrp neighbors --> Megjeleníti az EIGRP szomszédok adatait
  • show ip eigrp topology --> Megjeleníti az EIGRP-n keresztül tanult összes útvonalat és azok információit. Tartalmaz olyan útvonalakat is, amelyek jelenleg nem láthatók a show ip route kimenetében, és megmutatja az EIGRP Feasible Distance és Reported Distance értékeket

8.3 OSPF Útvonalak

  • show ip ospf database --> Megjeleníti az összes Link State Advertisement-et (LSA) a Link State Database-ben (LSDB)
  • show ip ospf neighbor --> Megjeleníti a router OSPF szomszédait
  • show ip ospf interface [interface-id] --> Részletes információkat jelenít meg az OSPF-et futtató összes interfészről, vagy a megadott konkrét interfészről
    • show ip ospf interface brief --> Tömör összefoglaló nézet az összes OSPF interfészről
Eredeti hivatkozása

Router Globális Konfigurációs Parancsok

Router Parancsok

Általános

  • router routing-protocol
  • network arguments --> Engedélyezi az útválasztó protokollt a megadott IP tartományba eső interfészeken
  • passive-interface interface-id --> Passzív interfészbe állítja az interfészt, így nem küld ki protokoll hirdetéseket (advertisements). A router továbbra is hirdeti az interfész hálózati prefixét
  • passive-interface default --> Alapértelmezés szerint minden interfészen bekapcsolja a passzív interfész módot
  • default-information originate --> Hirdeti az alapértelmezett útvonalat (default route) a szomszédok felé
  • no router-id --> Visszaállítja a router aktuális Router ID értékét
  • distance distance-value --> Módosítja az útválasztó protokoll administrative distance (AD) értékét
  • maximum-paths path-value --> Módosítja az Equal Cost Multi-Path (ECMP) során használható útvonalak maximális számát

RIP

  • router rip --> Belép a RIP konfigurációs módba
  • version 2 --> Átvált a 2-es RIP verzióra
  • no auto-summary --> Kikapcsolja az automatikus összegzést (auto-summarization), így nem alakítja át a classless címeket classful címekké
  • network ip-address --> Engedélyezi a RIP-et az adott IP tartományba eső összes interfészen

EIGRP

  • router eigrp autonomous-system-number --> Belép az EIGRP konfigurációs módba a megadott autonomous system csoportban
  • eigrp router-id a.b.c.d --> Módosítja az EIGRP router ID-t
  • no auto-summary --> Kikapcsolja az automatikus összegzést
  • network ip-address [wildcard-mask] --> Engedélyezi az EIGRP-t a megadott tartományba eső interfészeken. Opcionálisan wildcard maszk is használható

OSPF

  • router ospf process-id --> Belép az OSPF router konfigurációba a megadott process-hez
  • router-id a.b.c.d --> Módosítja az OSPF router ID-t
  • network ip-address wildcard-mask area area-number --> Engedélyezi az OSPF-et a megadott tartomány interfészein, és hozzárendeli őket a megadott area-hoz
  • auto-cost reference-bandwidth megabits-per-second --> Megváltoztatja a metrika/költség számításához használt alapértelmezett referencia sávszélességet
  • shutdown --> Leállítja az aktuális OSPF folyamatot OSPF konfigurációs módban

Eredeti hivatkozása

2. OSPF

  • clear ip ospf process --> Újraindítja az aktuális OSPF folyamatot
Eredeti hivatkozása

OSPF Interfész Parancsok

1. OSPF

  • ip ospf cost cost --> Módosítja az interfész költségértékét
  • ip ospf process-ID area area --> Közvetlenül az interfészen engedélyezi az OSPF-et
  • ip ospf priority priority --> Módosítja az interfész OSPF prioritását (a DR/BDR választásnál használatos)
  • ip ospf network network-type { broadcast / point-to-point / non-broadcast } --> Módosítja az interfészen használt OSPF hálózattípust
  • ip ospf hello-interval seconds --> Módosítja a Hello üzenet időzítőjét
  • ip ospf dead-interval seconds --> Módosítja a Dead üzenet időzítőjét
  • ip ospf authentication --> Engedélyezi az OSPF hitelesítést az aktuális interfészen
  • ip ospf authentication-key password --> Beállítja a hitelesítési kulcsot/jelszót az interfészen
Eredeti hivatkozása

Soros (Serial)

  • interface serial port/number --> Belép a soros interfész konfigurációs módba
    • clock rate bits-per-second --> Beállítja a soros interfész működési sebességét, a DCE (Data Communications Equipment) oldalon használatos
    • encapsulation protocol {ppp / hdlc} --> Megváltoztatja az encapsulation módot. A soros kapcsolat mindkét végén egyeznie kell
Eredeti hivatkozása


OSPF Információk

Loopback Interfészek

A loopback interfész egy virtuális interfész a routerben, amely mindig up/up állapotban van (kivéve, ha manuálisan leállítják / shutdown).

  • Nem függ fizikai interfésztől, ezért stabil, állandó IP-címet biztosít a router eléréséhez vagy azonosításához.

OSPF Hálózattípusok (Network Types)

Az OSPF többféle hálózattípust ismer, amelyeket különböző forgatókönyvekhez használnak, és eltérően viselkednek. A 3 legfontosabb:

  1. Broadcast
    • Alapértelmezés szerint engedélyezett az Ethernet és FDDI (Fiber Distributed Data Interface) interfészeken.
  2. Point-to-point
    • Alapértelmezés szerint engedélyezett a PPP (Point-to-Point Protocol) és HDLC (High-Level Data Link Control) kapcsolatokon.
  3. Non-broadcast
    • Alapértelmezés szerint engedélyezett a Frame Relay és X.25 interfészeken.

Hogyan módosítható a hálózattípus egy interfészen?

Az OSPF hálózattípusa az interfészen az ip ospf network NETWORK-TYPE paranccsal konfigurálható.

Hálózattípusok Összefoglaló Táblázata

BroadcastPoint-to-pointNon-broadcast
Alapértelmezett Ethernet és FDDI felületekenAlapértelmezett PPP és HDLC felületekenAlapértelmezett Frame Relay és X.25 felületeken
DR/BDR választás vanNincs DR/BDR választásNincs DR/BDR választás
A szomszédokat dinamikusan felderítiA szomszédokat dinamikusan felderítiA szomszédokat nem deríti fel dinamikusan
Alapértelmezett időzítők:
Hello - 10 másodperc
Dead - 40 másodperc
Alapértelmezett időzítők:
Hello - 10 másodperc
Dead - 40 másodperc
Alapértelmezett időzítők:
Hello - 30 másodperc
Dead - 120 másodperc

Broadcast Hálózattípus

A broadcast hálózattípus alapértelmezés szerint engedélyezve van az Ethernet és FDDI (Fiber Distributed Data Interface) interfészeken.

  • A routerek dinamikusan derítik fel a szomszédokat OSPF Hello üzenetek küldésével és fogadásával a 224.0.0.5 multicast címen.
  • Minden egyes alhálózaton (subnet) választani kell egy DR (Designated Router) és egy BDR (Backup Designated Router) routert. (Ha nincsenek OSPF szomszédok, csak egyetlen DR létezik.)
    • A hálózat minden más routere, amely nem DR vagy BDR, DROther állapotúvá válik.
    • A DR/BDR felé küldött üzenetek a 224.0.0.6 multicast címre mennek.

Fontos információ a DR/BDR és DROthers működéséről

  • A routerek csak a szegmens DR és BDR routerével létesítenek FULL OSPF szomszédságot (adjacency). Ezért a routerek csak a DR-rel és BDR-rel cserélnek LSA-kat.
  • Eközben a DROther routerek egymás között 2-way kapcsolatot tartanak fenn, és nem osztanak meg egymással LSA-kat. (Minden routernek azonos marad az LSDB-je, de ez nagymértékben csökkenti a hálózaton elárasztott LSA-k mennyiségét.)

  • Röviden:
    • A DR és a BDR FULL OSPF szomszédságot létesít a subnet MINDEN routerével.
    • A DROther routerek csak a DR/BDR routerekkel alakítanak ki FULL OSPF szomszédságot.

DR és BDR Választás

A DR és BDR megválasztásakor két értéket vizsgálnak, a következő prioritási sorrendben:

  1. Legmagasabb OSPF interfész prioritás (priority)
  2. Legmagasabb OSPF Router ID

Az első helyezett kapja a subnet DR szerepét, a második a BDR szerepét. A subnet összes többi routere DROther lesz.

  • A DR/BDR választás 'nem-preemptív' (non-preemptive), ami azt jelenti, hogy amint a DR és BDR megválasztásra került, megtartják szerepkörüket mindaddig, amíg az OSPF folyamat újra nem indul, vagy az interfész le nem áll / meg nem hibásodik.
    • Ha az OSPF folyamat újraindul, vagy a DR/BDR interfésze bármilyen okból leáll, a BDR azonnal átveszi a DR szerepét, és egy új BDR választást tartanak – még akkor is, ha időközben magasabb prioritású vagy magasabb Router ID-val rendelkező interfészek jelennek meg a hálózatban.

OSPF Interfész Prioritás

Az alapértelmezett OSPF interfész prioritás minden interfészen 1.
Ha az OSPF interfész prioritását 0-ra állítjuk, a router nem válhat DR-ré vagy BDR-ré az adott alhálózaton.

A prioritás interfészenként állítható, maximális értéke 255 az alábbi paranccsal:
ip ospf priority PRIORITY-VALUE


Point-to-Point Hálózattípus

A Point-to-Point hálózattípus alapértelmezés szerint engedélyezett a PPP (Point-to-Point Protocol) és HDLC (High-Level Data Link Control) kapcsolatokon.

  • A routerek dinamikusan derítik fel a szomszédokat OSPF Hello üzenetek küldésével és fogadásával a 224.0.0.5 multicast címen.
  • Nincs DR/BDR választás, mivel ez a kapcsolattípus két eszköz között jön létre (pont-pont kapcsolat), így nincs szükség DR vagy BDR kijelölésére.

Soros (Serial) Interfészek

A soros (serial) interfészek régebbi technológiák, amelyeket még az Ethernet interfészek elterjedése előtt használtak.

  • Két csatlakozási végpontból áll, ahol az egyik oldal DCE-ként (Data Communications Equipment), a másik pedig DTE-ként (Data Terminal Equipment) működik.
  • A kapcsolat DCE oldala felelős az órajelért, azaz a kapcsolat működési sebességéért (clock rate).
  • Az alapértelmezett encapsulation soros interfészen a HDLC (Cisco eszközökön cHDLC).
    • Az encapsulation típusának mindkét oldalon egyeznie kell, különben mindkét interfész down állapotba kerül, és nem tudnak kommunikálni.

Órajel (Clock rate) VS. Sebesség (Speed)

Az Ethernet interfészek a speed MEGABITS-PER-SECOND paranccsal konfigurálják a működési sebességet.
Ezzel szemben a soros (Serial) interfészek a clock rate BITS-PER-SECOND parancsot használják.

Hogyan deríthető ki, melyik oldal a DCE és melyik a DTE?

A DCE és DTE szerep a show controllers serial INTERFACE-ID paranccsal ellenőrizhető, ahol az INTERFACE-ID az ellenőrizni kívánt soros interfész azonosítója.


OSPF Szomszédsági Követelmények (Neighbor Requirements)

Ahhoz, hogy az OSPF routerek szomszédokká váljanak, több feltételnek is meg kell felelniük. A legfontosabbak:

  1. Az OSPF folyamat nem lehet leállítva (shutdown)
  2. Az interfészeknek azonos alhálózatban (subnet) kell lenniük
  3. Az Area számnak egyeznie kell
  4. Az OSPF Router ID-knak egyedinek kell lenniük
  5. A Hello és Dead időzítőknek egyezniük kell
  6. A hitelesítési (authentication) beállításoknak egyezniük kell
  7. Az IP MTU beállításoknak egyezniük kell
  8. Az OSPF Network Type beállításnak egyeznie kell

Megjegyzés az IP MTU és Network Type kapcsán

A 7. pont (IP MTU egyezés) és a 8. pont (OSPF Network Type egyezés) esetén a routerek képesek lehetnek OSPF szomszédságot létesíteni, de a kapcsolat nem fog megfelelően működni.

  • Ezért, ha az OSPF show parancsok alapján minden rendben lévőnek tűnik, de a routing mégsem működik helyesen, mindenképp ellenőrizd a 7. és 8. pontokat!

OSPF LSA Típusok

Az OSPF LSDB az LSA-k listáját tartalmazza, és összesen 11 különböző típusú LSA létezhet ebben az adatbázisban. A CCNA szempontjából a három legfontosabb:

  1. Type 1 (Router LSA)
    • Minden OSPF router legenerálja ezt az LSA-t.
    • A routert a Router ID alapján azonosítja.
    • Felsorolja a router OSPF-aktivált interfészeihez csatlakozó hálózatokat.
  2. Type 2 (Network LSA)
    • Minden egyes multi-access hálózat DR routere generálja (mint pl. a broadcast hálózattípusnál).
    • Felsorolja azokat a routereket, amelyek csatlakoznak az adott multi-access hálózathoz.
  3. Type 5 (AS-External LSA)
    • Az ASBR routerek generálják olyan célállomások felé vezető útvonalak leírására, amelyek az AS-en (az OSPF domainen) kívül találhatók.

Graph View

  • Commands
  • Router Show Commands
  • Router Global Configuration Commands
  • OSPF Interface Commands
  • OSPF Information
  • Loopback Interfaces
  • OSPF Network Types
  • Network Type Table Summary
  • Broadcast Network Type
  • DR and BDR Election
  • Point-to-Point Network Type
  • Serial Interfaces
  • OSPF Neighbor Requirements
  • OSPF LSA Types

YouTube Channels

Jeremy's IT Lab
Practical Networking