fix ipv6 rib
This commit is contained in:
4
main.py
4
main.py
@ -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()
|
||||
Reference in New Issue
Block a user