VPN route remove

Hi All,

I wanted to know if there is a way that I can completely remove a route from routing table if my VPN goes down and push the routes to another router.

I am trying to get this resolved, but not getting any resolution.

You can write your own script to do this.
Write a script to monitor the VPN tunnels and reconfigure the routing table if and when VPN goes down.

https://wiki.vyos.net/wiki/Configuration_scripting

Thanks

Thanks @machanta
I will try to write my own script for this and will check if this works.

Also, wanted to know if blackhole will work in this situation?

Hello, @rituka!
It is not clear what exactly you want to do. Can you describe your situation more detailed?

Hi @zsdc . Yes sure.
So my issue is that I have been working since now on Cisco Routers/Switches and on those devices we can configure IPSLA to track any interface/IP/route.
With Vyos, we do not have this feature.
I have 2 VPN routes to a primary vyos router and to a secondary router.
If the primary VPN goes down, the connectivity goes down as well beacuse we still have the router for the primary,.
I want that if primary VPN goes down, the router should take the route via secondary vyos router (secondary VPN).

I hope I am clear now.

I am guessing you are talking blackhole routes. If yes then the answer yes.
You can change the config (pretty much replace the entire config if needed) of the VYOS from within your shell script.

Thanks

Hi

Can someone help me with a sample script config for the same.

I am new to vyos.

Hello, @rituka!
A classical way for your case is using dynamic routing protocols like BGP or OSPF combined with VPNs. For communication between routing daemons used IP addresses from VPN tunnels and if a connection goes down, then local routing daemon automatically removes all routes, received from the disconnected router.
Look carefully into dynamic routing. I’m pretty sure that you are looking for this.