Page MenuHomeVyOS Platform

GeoIP: an ASN rule in policy route empties the firewall's country-code sets
Open, NormalPublicBUG

Description

With an ASN match in policy route, a firewall commit that adds a country-code rule prints an error but succeeds, and the country set stays empty. Rules that depend on it stop matching without notice.

set policy route PBR rule 1 source geoip asn 64512
commit
set firewall ipv4 input filter rule 2868 source geoip country-code ad
commit
Updating GeoIP. Please wait...
Error: GeoIP failed to update firewall and/or policy

nft --file /run/nftables-geoip.conf (rule-set name replaced with PBR):

Error: No such file or directory; did you mean set 'GEOIP_ASN_route_PBR_1_s' in table ip 'vyos_mangle'?
flush set ip vyos_filter GEOIP_ASN_route_PBR_1_s
country-code set filled after the commit
1.5.1 (country rule only)   3/3
rolling (with ASN rule)     0/3

Cause
T5746 (dffcc04dc, https://github.com/vyos/vyos-1x/pull/5155) added ASN loops to geoip_update() in python/vyos/geoip.py. The country-code loops skip the other subsystem's paths (if path[0] == 'policy': continue, and 'firewall' for policy); the ASN loops do not. The update file then flushes a policy ASN set in the filter table, and nft rejects the whole file.

Suggested fix
Add the same subsystem skip to both ASN loops.

Details

Version
rolling
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Related Objects