Route-map that advertises routes from certain protocol to BGP

In Juniper, there is an option when creating route-maps to define the source of prefix. Example:

set policy-options policy-statement bgp-out term 1 from protocol static
set policy-options policy-statement bgp-out term 1 from protocol direct
set policy-options policy-statement bgp-out term 1 then accept

I’m just looking for a counterpart commands of that in VYOS. My goal is, before the export policy advertises a prefix, I want it to lookup at the route table (of that protocol) if it exists.

For instance, I want to advertise 0.0.0.0 to an iBGP peer, only if 0.0.0.0 exists in my BGP routing table.

There is an example of a configuration which allows exporting “default route” if it is configured as static route

set policy prefix-list default rule 10 action 'permit'
set policy prefix-list default rule 10 prefix '0.0.0.0/0'

set policy route-map FOO rule 10 action 'permit'
set policy route-map FOO rule 10 match ip address prefix-list 'default'

set protocols bgp address-family ipv4-unicast redistribute static

set protocols bgp neighbor 192.0.2.5 address-family ipv4-unicast route-map export 'FOO'
set protocols bgp neighbor 192.0.2.5 remote-as '65001'
set protocols bgp system-as '65001'

You can extend route-map match metric, tag, etc

Also, I created a feature request to get route-map more flexible T5163
Thanks!

thats great! thanks for the feature request.

Already available in the VyOS 1.4-rolling-202305030317 release

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.