Chuyển đến nội dung chính

Lesson 9: Dynamic Routing - OSPF

Configure OSPF dynamic routing on VyOS, including theory, practical examples, lab steps, and a summary.

Dynamic Routing - OSPF

Introduction to OSPF on VyOS

This lesson walks through configuring OSPF (Open Shortest Path First) on VyOS 1.4.x/1.5 rolling release. OSPF is a common dynamic routing protocol in enterprise networks.

1. OSPF fundamentals

  • Area: A logical domain used to divide an OSPF network.
  • LSA: Link State Advertisement, with types such as Type 1, 2, 3, etc.
  • Cost: Path weight that influences route selection.
  • SPF: Dijkstra algorithm used to compute shortest paths.

2. Basic OSPF configuration

set protocols ospf area 0 network 192.168.10.0/24
set protocols ospf area 0 network 192.168.20.0/24
set protocols ospf area 1 network 10.10.10.0/24
set protocols ospf parameters router-id 1.1.1.1
set protocols ospf passive-interface eth2
set protocols ospf redistribute connected
set protocols ospf redistribute static
  • OSPF Unnumbered and ECMP:
set protocols ospf interface eth3 network-type point-to-point
set protocols ospf parameters ecmp-limit 4

3. OSPF Authentication

set protocols ospf area 0 authentication md5
set protocols ospf area 0 authentication-key-id 1 md5-key "VyOSSecret"

4. Verify OSPF status

show ip ospf neighbor
show ip ospf route
show ip ospf database

5. Example network diagram

+---------+     +---------+     +---------+
| VyOS 1 |-----| VyOS 2 |-----| VyOS 3 |
| Area 0 |     | Area 0 |     | Area 1 |
+---------+     +---------+     +---------+

6. Hands-on lab: OSPF Multi-Area

  1. Configure OSPF on three VyOS routers as shown in the diagram.
  2. Set area, router-id, networks, and authentication.
  3. Commit and save the configuration:
commit
save
  1. Check OSPF state, neighbors, and routes.
show ip ospf neighbor
show ip ospf route

7. Summary

You now know how to configure OSPF on VyOS and apply it to enterprise networks with multiple areas, authentication, and dynamic routing control.