Page MenuHomeVyOS Platform

Allow route-map to set "src"
Closed, ResolvedPublic


When creating a route-map, the ability to use the quagga "set src" action would be very useful as it allows to configure the preferred local source when the system generates packets.

So for a practical usage, lets say I have a tunnel on which someone is routing a public IP to me.

I can then set the IP on a loopback, then configure the default route to but when the system generates packets, it would use as source. The solution is then to have a route-map in quagga :

access-list acl_to_gw permit

route-map RM_SET_SRC permit 10

match ip next-hop acl_to_gw
set src

But currently there is no way to get VyOS to generate that "set src" part.

Also need a way to have VyOS generate the "ip protocol static route-map RM_SET_SRC" part as well. Not sure if that's already possible or not.


Difficulty level
Normal (likely a few hours)

Event Timeline

syncer triaged this task as Normal priority.Aug 17 2016, 1:55 PM
syncer added subscribers: VyOS 1.1.x, VyOS 2.0.x.

This is my attempt :

It does generate what I expect. Although for it to work I had to remove the "match ip next-hop acl_to_gw" ... but that's unrelated I think, still investigating this.

Ok, so the main issue is that the route-map is only applied to routes installed _after_ it's been setup ... so you have to remove / readd all the static routes which obviously doesn't work when you reboot :(

You need "create" section in your templates/policy/route-map/node.tag/rule/node.tag/set/src/node.def to make things survive reboots, I think.

Changing the priorities, I managed to make it work and it's loaded fine on reboot.

But if you modify them at run-time, changes are not applied ... worse, if you want the policy, then edit static routes, quagga doesn't even properly changes the old routes ...

At the moment, I'm living with that limitation, but I think the best option would be to just hide the 'route-map' stuff from the user for the 'static' protocol and create them under the hood and just have a 'src' node configurable when creating static route.

This way, the sequencing of removing route-maps / routes and reapplying them can be enforced so that quagga doesn't get confused.

Can you push your recent changes to github?

I pushed the priority changes I had to do on my T132 branch.

However I'll probably try to implement the alternate version I described above. That'll have to wait a couple weeks though ... traveling abroad ATM.

syncer claimed this task.
syncer edited projects, added VyOS 1.2 Crux (VyOS 1.2.0-rc2); removed VyOS 1.2 Crux.
syncer moved this task from Needs Triage to Finished on the VyOS 1.2 Crux (VyOS 1.2.0-rc2) board.