40% Complete
127. Introduction
https://www.udemy.com/course/ccna-complete/learn/lecture/7841054?start=0#overview
128. OSPF Characteristics
https://www.udemy.com/course/ccna-complete/learn/lecture/7841060#overview
Open Shortest Path First
- Link State routing protocol
- Supports large networks
- Fast convergence time
- Multicast
- Open standard protocol (unlike EIGRP)
- Uses Dijkstra’s Shortest Path First algorithm to determine the best path to learned networks.
OSPF vs EIGRP vs RIP
- RIP has scalability limitations so typically not used in production
- Suitable for small networks, lab/test environments
- Most companies opt for their Interior Gateway Protocol is either EIGRP or OSPF
- EIGRP
- Simple to implement and troubleshoot
- Historically proprietary
- Now Open, but not necessarily supported on non-IOS devices.
- OSPF is most commonly used
- Supports large networks
- Open standard so supported on all devices.
Link State Routing Protocols
- With Link State routing protocols, each router describes itself and its interfaces to its directly connected neighbors
- Information is passed unchanged from one router to another
- This is the difference between Link State and Distance Vector routing protocols.
- No “Routing by rumor”
- Every router learns the full picture of the network, including every router, its interfaces and what they connect to.
- OSPF uses LSA (Link State Advertisements) to pass on routing updates.
OSPF Operations
- Discover Neighbors
- Form adjacencies
- Flood Link State Database (LSDB)
- Compute Shortest Path
- Install best routes in routing table
- Respond to network changes
OSPF Packet Types
- Hello: Router will send out and listen for Hello packets when OSPF is enabled on an interface, then form adjacencies with other OSPF routers on the link.
- DBD Database Description: Adjacent routers will tell each other the networks they know about with the DBD packet
- LSR Link State Request: If a router is missing information anout any of the networks in the received DBD, it will send its neighbor an LSR.
- LSA Link State Advertisement: A routing update (Follows an LSR)
- LSU Link State Update: Contains a list of LSA’s which should be updated, used during flooding. (flooding = information that needs to go everywhere, such as a link going down.)
- LSAck: Receiving routers acknowledge LSAs. This verifies the protocol is reliable.
129. OSPF Basic Configuration
https://www.udemy.com/course/ccna-complete/learn/lecture/7841062#overview
Process ID
(config)#router ospf 1
- Different interfaces can run in different instances of OSPF
- Different instances have different List State Databases
- Typically only 1 instance is configured on OSPF routers.
- Multiple Process IDs are rarely used
- The Process ID is locally significant. It does not have to match on the neighbor router to form an adjacency.
Abnormal Configuration
R2(config)#router ospf 2 R2(config-router)#network 10.0.0.0 0.0.0.255 area 0 R2(config-router)#router ospf 3 R2(config-router)#network 10.1.0.0 0.0.0.255 area 0
- R2 will form adjacencies with R1 and R3 even though the Process IDs do not match
- R1 and R3 will NOT learn each other’s routes because they are in different Process IDs on R2
Normal Configuration
R2(config)#router ospf 1 R2(config-router)#network 10.0.0.0 0.0.0.255 area 0 R2(config-router)#network 10.1.0.0 0.0.0.255 area 0
Network
R1(config)#router ospf 1 R1(config-router)#network 10.0.0.0 0.0.0.255 area 0
- Like EIGRP, the OSPF network command uses a wildcard mask instead of a subnet mask
- To create a wildcard mask from a subnet mask, subtract each octet in the subnet mask from 255.
- Subnet mask 255.255.0.0 = Wildcard mask 0.0.255.255
- Subnet mask 255.255.255.252 = Wildcard mask 0.0.0.3
- Unlike EIGRP, the wildcard mask does not default to the classful boundary.
- Failure to add the wildcard mask will result in an incomplete command notice.
- You must enter a wildcard mask for each network.
What the network command means:
- Look for interfaces with an IP address that falls within this range
- Enable OSPF on those interfaces
- Send out and listen for OSPF hello messages
- Peer with adjacent OSPF routers.
- Advertise the network and mask which is configured on those interfaces.
R1(config-router)#network 10.0.0.0 0.0.255.255 area 0
- Int FE1/0 and FE2/0 fall within the range.
- Int FE0/0 does not.
- Enable OSPF on FE1/0 and 2/0 and peer with adjacent OSPF routers
- Networks advertised
- 10.0.1.0/24
- 10.0.2.0/24
- 10.1.0.0/24 is NOT advertised
- 10.0.0.0/16 is NOT advertised
Troubleshooting Commands
# Show OSPF configuration sh run | section ospf # Show if it is enabled sh ip protocols # Show OSPF interfaces enabled sh ip ospf interface brief # Show OSPF neighbors (adjacencies) # Often ran after enabling! sh ip ospf neighbor
OSPF Operations
- Discover Neighbors
- Form adjacencies
- sh ip ospf neighbor
- Flood Link State Database (LSDB)
- Compute Shortest Path
- Install best routes in routing table
- sh ip route
- Respond to network changes
130. OSPF Basic Configuration Lab Demo
https://www.udemy.com/course/ccna-complete/learn/lecture/7841066#overview
Getting started –
# all routers and L3 switches copy ips-set running-config # Routers only configure terminal int f0/1 no shut end # Finally, check for any lingering static routes and remove them. sh ip route
Enable OSPF on all routers
config t router ospf 1 network 10.0.0.0 0.255.255.255 area 0 end
Verify the configuration took place
Note: This took a little longer to propagate than I expected. 30 seconds maybe?
sh run | section ospf sh ip protocols sh ip ospf neighbor sh ip route
Troubleshooting
If the routes are not showing, check to see if they are being received.
R1#sh ip ospf database OSPF Router with ID (172.22.22.8) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 10.1.0.2 10.1.0.2 411 0x80000003 0x0028AE 2 10.1.1.2 10.1.1.2 412 0x80000003 0x00626F 2 10.1.3.2 10.1.3.2 411 0x80000002 0x008A29 2 172.22.22.8 172.22.22.8 410 0x80000002 0x002CBF 4 203.0.113.2 203.0.113.2 412 0x80000002 0x009CA7 3 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 10.0.0.1 172.22.22.8 410 0x80000001 0x009CC3 10.0.3.1 172.22.22.8 410 0x80000001 0x00A2B7 10.1.0.1 10.1.1.2 416 0x80000001 0x009371 10.1.1.1 203.0.113.2 413 0x80000001 0x00F2AD 10.1.3.1 203.0.113.2 412 0x80000001 0x00F6A5
Other Troubleshooting
R1#sh ip ospf int brief Interface PID Area IP Address/Mask Cost State Nbrs F/C Fa1/0/4 1 0 10.0.3.1/24 10 DR 1/1 Fa1/0/3 1 0 10.0.2.1/24 1 DR 0/0 Fa1/0/2 1 0 10.0.1.1/24 1 DR 0/0 Fa1/0/1 1 0 10.0.0.1/24 1 DR 1/1
131. OSPF Advanced Topics
https://www.udemy.com/course/ccna-complete/learn/lecture/7841068#overview
OSPF Router ID
- OSPF Routers identify themselves using ans OSPF Router ID, which is in the form of an IP address. (Similar to EIGRP)
- This will default to the highest IP address configured on any loopback interfaces
- Otherwise will be the highest IP address configured on a standard interface
- Finally, you can manually set the Router ID
- Loopbacks are recommended because they never go down and should not change.
- 2nd best: manually set
- Manually setting the ID after OSPF has started will require a restart to use the new ID
View a Router’s OSPF ID:
sh ip protocols
Manually set the ID
This doesn’t have to be a real IP, but makes more sense if you use one.
router ospf 1 router-id 2.2.2.2
Note: You can force this to take affect using the following command from the enable prompt:
clear ip ospf process
Passive Interface Configuration
- Information on passive interfaces will be shared with other routers.
- OSPF routing information will not be passed to their connected routers.
- For loopbacks, this serves 2 purposes
- Loopbacks do not directly connect to anything, so no information can be sent through them.
- This allows other routers to learn how to access those addresses.
- For loopbacks, this serves 2 purposes
router ospf 1 passive-interface loopback 0 passive-interface f2/0
Setting Passive Interfaces as default
router ospf 1 passive-interface default # Enable on each required interface no passive-interface f0/0 no passive-interface f0/1
Default Route Injection
- Start with a static route
- Configure OSPF to share that information
R4(config)#ip route 0.0.0.0 0.0.0.0 203.0.113.2 router ospf 1 default-information originate
Verify by checking the other routers
R1#sh ip route ... Gateway of last resort is 10.0.0.2 to network 0.0.0.0 ... O*E2 0.0.0.0/0 [110/1] via 10.0.0.2, 00:00:15, FastEthernet1/0/1
132. OSPF Advanced Topics Lab Demo
https://www.udemy.com/course/ccna-complete/learn/lecture/29818230#overview
Configure Loopbacks
Check to see if any are pre-configured
sh ip int brief
If not, configure them
config t int loopback 0 ip address 172.22.22.2 255.255.255.255 end
Configure OSPF
config t router ospf 1 network 10.0.0.0 0.255.255.255 ! Set the default route default-information originate ! set loopbacks as passive interfaces passive-interface loopback 0 ! advertise the 172.22.22.0 loopbacks network 172.22.22.0 0.0.0.255 ! set any non-local connections (i.e. internet) passive-interface f1/0/4 end
133. OSPF Areas
https://www.udemy.com/course/ccna-complete/learn/lecture/7841084#overview
Why OSPF Areas
- Every router learns the full picture of the network including every router, it’s interfaces and what they connect to
- This can cause issues in larger networks
- Too many routes can use up too much router memory
- Network changes cause all routers to reconverge, which takes time and CPU.
- OSPF supports a hierarchical design that segments large networks into smaller areas to solve this issue.
- Each router maintain full information about its own area, but only summary information about other areas.
How OSPF Areas Work
- A two-level hierarchy is used.
- Transit area (backbone or Area 0). Does not generally contain end users.
- Regular areas (nonbackbone areas). Used to connect end users to the Transit area.
- By default, all transit traffic goes through the Transit area.
- Small networks do not require a hierarchical design and all routers can be in Area 0.
R1(config-router)# network 10.0.0.0 0.0.255.255 area 0
- The area is configured at the interface level with the ‘network’ command.
- For a router to form an adjacency, its neighbor must be configured to be in the same area.
OSPF Router Types
Backbone Routers
- Routers that have ALL their OSPF interfaces in Area 0 are Backbone Routers.
- Routers maintain a full LSDB (Link State Database) of other routers and links in their own area.
Internal Routes
- Routes received from other routers in the same area appear as Internal OSPF routes
R3#sh ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 ... O 10.1.2.0/24 [110/2000] via 10.1.1.1, 00:08:53, FastEthernet0/0 O 10.1.3.0/24 [110/2500] via 10.1.1.1, 00:04:04, FastEthernet0/0 O 203.1.113.0/24 [110/2000] via 10.1.1.1, 00:08:41, FastEthernet0/0
ABRs – Area Boarder Routers
- Routers that have interfaces in multiple areas are Area Boarder Routers (ABRs)
- Highlighted in Red
Characteristics of ABRs
- Separates LSA Flooding zones
- Becomes the primary point for area address summarization.
- OSPF Summarization is always done on ABRs!
- Functions regularly as the source for default routes
- Maintains the LSDB (Link State Database) for each area with witch it is connected.
- It maintains all information for all areas it is connected to.
- The ideal design is to have each ABR connected to two areas only.
- The backbone and another.
- Three areas are the upper limit.
Manual Summarization
- ABRs do NOT automatically summarize!
- If you do not summarize, all routes are flooded everywhere!
config t router ospf 1 network 10.1.0.0 0.0.255.255 area 0 network 10.0.0.0 0.0.255.255 area 1 area 0 range 10.1.0.0 255.255.0.0 area 1 range 10.0.0.0 255.255.0.0
Inter Area Routes
- Routes to other areas appear as Inter Area ‘IA’ Routes
sh ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 ... O IA 10.0.0.0/16 [110/2000] via 10.1.0.2, 00:08:53, FastEthernet1/0 O 192.168.8.0/24 [110/2500] via 10.1.1.1, 00:04:04, FastEthernet0/0 O 203.1.113.0/24 [110/2000] via 10.1.1.1, 00:08:41, FastEthernet0/0
Normal Area Routers
- Routers that have all of their OSPF interfaces in a normal area are normal internal routers.
- Maintain a full LSDB of all other routers and links in their own area.
- They learn Inter Area routes to other areas from their ABRs.
Autonomous System Boundary Routers – ASBRs
- Routers that redistribute into OSPF are Autonomous System Boundary Routers.
- Perhaps running EIGRP or RIP or another protocol, and translating them to OSPF
- These show up as External Routes
sh ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 ... O*E2 0.0.0.0/0 [110/1] via 10.1.1.1, 00:19:35, FastEthernet0/0
- This does not mean the route came from outside the organization, but simply means it was redistributed from outside OSPF
134. OSPF Areas Lab Demo
https://www.udemy.com/course/ccna-complete/learn/lecture/27434094#overview
Single Area OSPF Lab
Multi Area OSPF Lab
- R3 and R4 are Backbone Routers in Area 0
- R2 and R5 are ABRs (Area Boarder Routers)
- R1 Normal Area Router in Area 1
Backbone Routers (R3 and R4)
config t router ospf 1 network 10.1.0.0 0.0.255.255 area 0
ABRs – R2 and R5
config t router ospf 1 network 10.1.0.0 0.0.255.255 area 0 network 10.0.0.0 0.0.255.255 area 1 area 0 range 10.1.0.0 255.255.0.0 area 1 range 10.0.0.0 255.255.0.0
Area 1 – R1
config t router ospf 1 network 10.0.0.0 0.0.255.255 area 1
135. Bandwidth vs. Clock Rate and Speed
https://www.udemy.com/course/ccna-complete/learn/lecture/17451548#overview
The ‘speed’ Command
- The rate the Ethernet interfaces physically transmit at is set by the `speed` command.
- GigabitEthernet interfaces transmit at 1000Mbps by default
- FastEthernet interfaces transmit at 100Mbps by default
- If you use the
speed 10command on a FastEthernet interface, it will physically transmit at 10Mbps
The ‘clock rate’ Command
- Work on Serial interfaces
- Serial interfaces transmit at 1.544 Mbps by default
- If you use the
clock rate 64000command on a Serial interface, it will physically transmit at 64 Kbps
The ‘bandwidth’ Command
- Interfaces also have default bandwidth (eg 100 Mbps on FastEthernet, 1.544 Mbps on a serial interface)
- The bandwidth usually matches the physical transmission rate of the interface.
- The `bandwidth` setting on an interface does not affect the physical transmission rate. These are instead set by
speedorclock rate.- If you set a bandwidth of 50 Mbps on a FastEthernet interface, it will still transmit at 100 Mbps.
- The `bandwidth` command affects the software policy on the router, such as which path will be selected by EIGRP or OSPF, or how much bandwidth will be guaranteed to a traffic type by QoS (Quality of Service).
- You can influence software policy by setting the bandwidth on an interface.
136. OSPF Cost Metric
https://www.udemy.com/course/ccna-complete/learn/lecture/7841078#overview
Metric Calculation
- Since OSPF is a Link State routing protocol, the router will learn about all destinations in its area, the links and their cost.
- The router will select routes based on its lowest cost to get to the destination.
Multi-area networks
- In a multiple area OSPF network, ABRs know the information for each are they are connected to.
- When multiple areas are in use, each router has individual routes for each IP subnet in its own area, and summary routes to other areas which go via an ABR.
Single / Same area networks
- For destinations in its own area, a router looks at all available links to get there, and chooses the path with the lowest overall cost.
- For destinations to another area, a router looks at all available links to get to the ABR and chooses the path with the lowest overall cost to the ABR. It’s then up to the ABR to choose the best path onwards from there.
SPF Shortest Path First Algorithm
- The SPF Shortest Path First algorithm calculates the overall cost for each available path to each destingation network, then selects the lowest cost path.
- Overall cost = cumulative cost of all outgoing interfaces.
- You should ensure the cost is set the same on the interfaces on both sides of a link or you can get asymmetric routing.
Example
- From the 203.0.113.0 network (R4 FE1/0) to 10.0.1.0 network (R1 FE1/0)
- Total Cost on R4 FE0/0 > R3 FE1/0 > R2 FE0/0 > R1 FE1/0
- Total Cost on R4 FE2/0 > R5 FE3/0 > R1 FE1/0
- In the opposite direction: 10.0.1.0 network (R1 FE1/0) to
137. OSPF Cost Metric Lab Demo
138. OSPF Adjacencies
139. OSPF Adjacencies Lab Demo
140. OSPF DR and BDR Designated Routers
141. OSPF DR and BDR Designated Routers Lab Demo
142. OSPF Configuration – Lab Exercises











