Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ospf_route = "O 10.0.24.0/24 [110/41] via 10.0.13.3, 3d18h, FastEthernet0/0"
- ospf_route = ospf_route.replace('O', 'OSPF').replace(',', '').replace('[','').replace(']','')
- ospf_route = ospf_route.split()
- ospf_route.remove('via')
- proto, prefix, ad_metric, next_hop, last_update, out_int = ospf_route
- output = '''
- {:25}{}
- {:25}{}
- {:25}{}
- {:25}{}
- {:25}{}
- {:25}{}
- '''
- print( output.format('Protocol:', proto,
- 'Prefix:', prefix,
- 'AD/Metric:', ad_metric,
- 'Next-Hop:', next_hop,
- 'Last update:', last_update,
- 'Outbound Interface:', out_int))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement