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 172.16.0.0/24
    • Here, two router’s interfaces are connected within this network address (172.16.0.0/24).
      • Example: vyatta router’s interface eth1 with ip 172.16.0.2/24 is connected to another router’s interface eth1-> 172.16.0.1/24.
      • 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 172.168.0.2/24
  • 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} ;

do 

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

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

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

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

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

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

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

done

  • 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

Caveat:

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:

https://techieindoor.com/go-lang-tutorial/

References:

https://en.wikipedia.org/wiki/Vyatta

Posted in networking

Leave a Reply

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