VyOS renders some BGP lines that FRR does not print back in its running configuration, either because they are FRR defaults or inherited from a peer-group, or because FRR prints them in a different form. frr-reload therefore sees a difference on every reload and applies them again, each in its own `router bgp ...` block.
This task covers these three:
| rendered line (`data/templates/frr/bgpd.frr.j2`) | FRR prints instead |
|---|---|
| `neighbor <member> activate`: rendered for every neighbor with address-family configuration, peer-group members included | nothing when the member's peer-group is active in that address family: the member inherits it (`bgp_config_write_peer_af` prints a member's `activate` only if its group is not active) |
| `bgp conditional-advertisement timer 60`: always rendered, the CLI default is 60 | nothing: 60 is FRR's default |
| `route-target both <rt>` under a VRF's `address-family l2vpn evpn` | `route-target import <rt>` and `route-target export <rt>`: FRR never prints `both` for EVPN, so frr-reload deletes both lines and re-adds `both` |
Reproduced on stock VyOS 1.5.1: with BGP peer-group members that have their own address-family settings, the default `conditional-advertisement timer`, and a VRF with `address-family l2vpn-evpn route-target both`, a commit that changes nothing in BGP re-sends the member `activate` lines, the timer and the route-targets on every reload, each line in its own `router bgp ...` block, once in pass 0 and twice in pass 1. In the test configuration (17 peer-group members, the default instance and three VRFs) that is 24 blocks in pass 0 (17 `activate`, 4 timer, 3 route-target) and 48 in pass 1.
**Possible fix direction.**
- `activate`: skip a member's line when its peer-group has the same address family configured (the group's own `activate` is rendered); keep it when the group does not have that address family. Applies to `neighbor ... peer-group` and `neighbor ... interface peer-group`.
- timer: render `bgp conditional-advertisement timer` only when it is not 60.
- EVPN route-target: render `both` as two lines, `route-target import <rt>` and `route-target export <rt>`, as FRR prints it.