mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/frrr - Allow both IPv6 and IPv4 instead of just IPv4 (#3345)
OPNsense supports BGP on both IPv4 and IPv6, but the current frr/setkey script implementation only adds SAD entries for IPv4. Changing -4 to -n keeps filtering on numeric addresses, but adds SAD entries for both IPv4 and IPv6 instead of only IPv4. Tested working on a Vultr VM with BGP enabled and MD5 password on the Vultr side.
This commit is contained in:
@@ -60,9 +60,9 @@ if __name__ == '__main__':
|
||||
with tempfile.NamedTemporaryFile(mode='wt', delete=False) as fo:
|
||||
temp_filename = fo.name
|
||||
for policy in registered_policies:
|
||||
fo.write("delete -4 %(src)s %(dst)s tcp 0x1000;\n" % policy)
|
||||
fo.write("delete -n %(src)s %(dst)s tcp 0x1000;\n" % policy)
|
||||
for new_policy in frr_sad:
|
||||
fo.write('add -4 %(src)s %(dst)s %(protocol)s %(spi)s -A %(aalgo)s "%(key)s";\n' % frr_sad[new_policy])
|
||||
fo.write('add -n %(src)s %(dst)s %(protocol)s %(spi)s -A %(aalgo)s "%(key)s";\n' % frr_sad[new_policy])
|
||||
|
||||
if temp_filename:
|
||||
subprocess.run(["/sbin/setkey", "-f", fo.name], capture_output=True, text=True)
|
||||
|
||||
Reference in New Issue
Block a user