Categories
Networking OpenWRT Routing

Dynamic Routing using OSPF on OpenWRT

Let’s face it, managing multiple route statements across multiple routers can be a hassle.  Dynamic routing protocols such as OSPF were designed to alleviate some of the stress. The more routes you must configure manually, the more prone to error things tend to become.  Just one bad route statement can crash your entire network! This is why it makes sense to keep manual route configuration to a minimum.

Implementing OSPF on an OpenWRT platfom is not terribly complicated. This solution works quite well if you are installing multiple routers within a single building, such as a hotel or large office. Dynamic routing using OSPF may also be implemented in a multi-building scenario, such as remote offices linked by VPN.

This is the abridged method for installing and configuring OSPF on a router powered by OpenWRT. This tutorial is not intended for the beginner. If you don’t know your way around OpenWRT or OSPF, I would suggest learning about these technologies first.

  1. Login to your router terminal via SSH.
  2. Update your installation packages:
opkg update
  1. Install the underlying packages required for OSPF configuration and operation:
opkg install quagga quagga-libospf quagga-libzebra quagga-ospfd quagga-vtysh quagga-zebra
  1. Launch the newly installed vtysh configuration interface:
vtysh
  1. Enter configuration mode:
conf t
  1. Enter OSPF mode:
router ospf
  1. Assign network subnets to OSPF area numbers. Repeat this command for each unique subnet associated with an interface on your router:
network xxx.xxx.xxx.xxx/yyy area nnn.nnn.nnn.nnn
  1. Now save the configuration:
do wr
  1. Exit OSPF mode:
exit
  1. Now exit configuration mode:
exit
  1. Also exit the vtysh utility:
exit
  1. Finally, restart the quagga service, which will now be responsible for maintaining route tables dynamically via OSPF:
/etc/init.d/quagga restart

Leave a Reply