fix ipv6 rib

This commit is contained in:
arT
2025-08-06 15:46:47 +08:00
parent 260b31f271
commit 0bcef4d88b

View File

@ -106,7 +106,7 @@ if __name__ == "__main__":
show_output = switch_connect.send_command(show_command)
if not show_output.strip():
ptp = ipaddress.ip_network(f'{re.findall(r'inet6\s+([\da-f:]+)', show_output)}/127')[1]
config_command = [ f'set routing-instances {VRF} routing-options static route {ip}/{cidr} next-hop {ptp}' ]
config_command = [ f'set routing-instances {VRF} routing-options rib {VRF}.inet6.0 static route {ip}/{cidr} next-hop {ptp}' ]
switch_connect.send_config_set(config_command)
switch_connect.disconnect()
elif args.action == "del":
@ -130,6 +130,6 @@ if __name__ == "__main__":
show_output = switch_connect.send_command(show_command)
if not show_output.strip():
ptp = ipaddress.ip_network(f'{re.findall(r'inet6\s+([\da-f:]+)', show_output)}/127')[1]
config_command = [ f'delete routing-instances {VRF} routing-options static route {ip}/{cidr} next-hop {ptp}' ]
config_command = [ f'delete routing-instances {VRF} routing-options rib {VRF}.inet6.0 static route {ip}/{cidr} next-hop {ptp}' ]
switch_connect.send_config_set(config_command)
switch_connect.disconnect()