Menu Close

vyatta – Ospf configuration on vyatta router

Here, We will look into how to do ospf configuration on vyatta router. You can follow given below steps to establish ospf session between vyatta router to other vendor routers.

Steps to configure ospf configuration on vyatta enabled router:

Configuration in config mode in vyatta router:

  • Go to config mode in vyatta router.
  • fire command: router ospf
  • Fire command: set protocols ospf area 0 network
    • Here, two router’s interfaces are connected within this network address (
      • Example: vyatta router’s interface eth1 with ip is connected to another router’s interface eth1->
      • Both router’s interface should be in same subnet.
  • Fire command: set protocols ospf area redistribute static
  • fire “exit” command to come out from router ospf mode: exit

Configuration in interface mode in vyatta router:

  • Fire command: set interfaces ethernet eth0 address dhcp
  • Fire command: set interfaces ethernet eth1 address
  • Fire command: set interfaces ethernet eth1 ip ospf
  • Now check ospf session. It should be established.

Note: Do ospf configuration on peer router also.

Shell script to generate static routes for vyatta router:

for I in {1..200} ;


echo "protocols {" >> /config/abc.boot; 

echo "static {" >> /config/abc.boot; 

echo "route 10.12.$I.0/24 {" >> /config/abc.boot; 

echo "next-hop {" >> /config/abc.boot;
echo "}" >> /config/abc.boot;

echo "}" >> /config/abc.boot;  

echo "}" >> /config/abc.boot;

echo "}" >> /config/abc.boot;  


  • This script will generate abc.boot file in /config/abc.boot path.

How to load abc.boot file to configure static routes in vyatta router:

  • Go to config mode: config
  • fire command: load abc.boot


First do static router configuration then do ospf configuration. If you do ospf configuration first then load the file abc.boot to configure static route. All the previous configuration will be removed.

To learn more about golang, Please refer given below link:


Posted in networking

Leave a Reply

Your email address will not be published. Required fields are marked *