I am trying to implement and test BGP in a lab environment. Due to some error, I have assigned wrong AS numbers to the routers and I would like to change that. Simply running the same commands with the correct configuration does not work. I have also tried to reset the BGP connection. But that resets the peers and not the router settings. Is there a way to simply remove any ad all BGP configurations that are present on teh router and such that the router will then have no instabnce of BGP running and I can start afresh with the configurations?
This should work (but removes all bgp config):
no router bgp [old ASN]
router bgp [new ASN]
(rest of new config)