[IM] Add option to use a db query to map sFLOW VLAN to peering VLAN #931
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For our resold members, the Peering Manager view was not showing bilateral peering sessions existing, despite a BGP session being configured and up.
The BGP session was being correctly identified from sFLOW, and added to the database, however, IXPM only appears to show bilateral peering sessions where the VLAN is a peering LAN in its database.
For resellers, we use Arista port VLAN translation feature. Arista sends the original VLAN via sFLOW and not the translated VLAN. Therefore the VLAN which is received via sFLOW is not in IXP Manager's database / does not have peering matrix option enabled. The portal excludes this when showing peering sessions in the Peering Manager view.
(It would be nice if Arista had a config option to send the translated VLAN via sFLOW, but I could not find such a thing. I suspect this may be non-trivial given it's usually done in hardware...)
This PR adds a config option for
sflow-detect-ixp-bgp-sessionsto use an sql query to map the resold customer VLANs back to the correct peering VLAN, as configured in IXP Manager.Scenario:
Resold customer interface is:-
If enabled, an sql query (also configurable) will be used to map the resold VLAN IDs back to the peering VLAN, and this VLAN will be added to the database instead.
The easiest thing to do[1] is a query which just extracts the VLAN ID from the interface name for all resold customers, together with the VLAN id for the peering VLAN as configured in IXP Manager.
So we end up with a table like:-
[1] Actually, the easiest/laziest thing to do in our case is:
if ($vlan >= 500) ... { $vlan = 4 }- but that is quite a "LONAP-specific" workaround.