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.
- Login to your router terminal via SSH.
- Update your installation packages:
opkg update
- Install the underlying packages required for OSPF configuration and operation:
opkg install quagga quagga-libospf quagga-libzebra quagga-ospfd quagga-vtysh quagga-zebra
- Launch the newly installed vtysh configuration interface:
vtysh
- Enter configuration mode:
conf t
- Enter OSPF mode:
router ospf
- 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
- Now save the configuration:
do wr
- Exit OSPF mode:
exit
- Now exit configuration mode:
exit
- Also exit the vtysh utility:
exit
- Finally, restart the quagga service, which will now be responsible for maintaining route tables dynamically via OSPF:
/etc/init.d/quagga restart