06-22-2021 10:34 PM
I use Netmiko to ssh to a cisco router and I was trying to apply the BGP configuration using ssh_conn.send_config_set(). Below is a sample configuration to be applied. Expected behavior:
bgp router-id x.x.x.x should be configured under the vrf address family. For some reason, when I tested manually, router didn't change the prompt and hence applied all the configuration to the global mode instead of address family mode and resulted in a BGP flap. Is there any way to check the prompt before applying the configuration?
''' R1(config)#router bgp asn R1(config-router)# R1(config-router)#no address-family ipv4 vrf vrf_name R1(config-router)# address-family ipv4 vrf vrf_name % Topology f959c5b8b::VPNv4 Unicast::base is currently being deconfigured. R1(config-router)# bgp router-id x.x.x.x '''
06-23-2021 03:35 AM
Get expect Mode config prompt and compare and before apply the config.
06-23-2021 06:47 AM
Thanks for your response. Is there a way how you do that in Netmiko? I couldn't find the solution so far. I was using send_config_set() for sending the these commands in a list.
06-23-2021 08:50 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide