say i want to delete a peer group that looks like this
set protocols bgp peer-group fabric address-family ipv4-unicast route-map export 'FABRIC_OUT' set protocols bgp peer-group fabric address-family ipv4-unicast route-map import 'FABRIC_IN' set protocols bgp peer-group fabric address-family ipv4-unicast soft-reconfiguration inbound set protocols bgp peer-group fabric address-family ipv6-unicast route-map export 'FABRIC_OUT' set protocols bgp peer-group fabric address-family ipv6-unicast route-map import 'FABRIC_IN' set protocols bgp peer-group fabric address-family ipv6-unicast soft-reconfiguration inbound set protocols bgp peer-group fabric remote-as 'internal'
if i delete by running delete protocols bgp peer-group fabric and then do compare commands, it results in this output:
delete protocols bgp peer-group fabric address-family ipv4-unicast route-map export 'FABRIC_OUT' delete protocols bgp peer-group fabric address-family ipv4-unicast route-map import 'FABRIC_IN' delete protocols bgp peer-group fabric address-family ipv4-unicast soft-reconfiguration inbound delete protocols bgp peer-group fabric address-family ipv6-unicast route-map export 'FABRIC_OUT' delete protocols bgp peer-group fabric address-family ipv6-unicast route-map import 'FABRIC_IN' delete protocols bgp peer-group fabric address-family ipv6-unicast soft-reconfiguration inbound delete protocols bgp peer-group fabric remote-as 'internal'
if i take this output and copy/paste it to another vyos device, it doesn't remove the full configuration, the address-family ipv4/ipv6 statements still exist, along with the peer-group itself since the comparison won't explicitly indicate we're removing the peer group.
this isn't unique to bgp peer groups, you can demonstrate this with pretty much any configuration with nested nodes
maybe vyos can make it more obvious? instead of the above output when running compare commands vyos can instead show that a leaf is being explicitly removed?
notice the explicit statements that remove the address-families and peer-group
delete protocols bgp peer-group fabric address-family ipv4-unicast route-map export 'FABRIC_OUT' delete protocols bgp peer-group fabric address-family ipv4-unicast route-map import 'FABRIC_IN' delete protocols bgp peer-group fabric address-family ipv4-unicast soft-reconfiguration inbound delete protocols bgp peer-group fabric address-family ipv4-unicast delete protocols bgp peer-group fabric address-family ipv6-unicast route-map export 'FABRIC_OUT' delete protocols bgp peer-group fabric address-family ipv6-unicast route-map import 'FABRIC_IN' delete protocols bgp peer-group fabric address-family ipv6-unicast soft-reconfiguration inbound delete protocols bgp peer-group fabric address-family ipv6-unicast delete protocols bgp peer-group fabric remote-as 'internal' delete protocols bgp peer-group fabric