Page MenuHomeVyOS Platform

BGP remote-as and local-as validation is overly restrictive
Open, NormalPublicBUG

Description

The BGP remote-as and local-as validation logic seems to be overly restrictive. This was added in https://vyos.dev/T4368 back in the days, but doesn't seem to apply anymore.

In vyos-1x/src/conf_mode/protocols_bgp.py:

# Neighbor AS specified for local-as and remote-as can not be the same
if dict_search('remote_as', peer_config) == asn and neighbor != 'peer_group':
    raise ConfigError(f'Neighbor "{peer}" has local-as specified which is '\
                    'the same as remote-as, this is not allowed!')

However, this appears to work just fine in VyOS 1.5 / rolling 2026.03.29-0031 when you do it directly via vtysh:

vyos(config)# router bgp 123
vyos(config-router)# neighbor 1.1.1.1 remote-as 555
vyos(config-router)# neighbor 1.1.1.1 local-as 555
vyos(config-router)# neighbor 10.200.0.91 remote-as 65528
vyos(config-router)# neighbor 10.200.0.91 local-as 65528 no-prepend replace-as 
vyos(config-router)# address-family ipv4 unicast 
vyos(config-router-af)# neighbor 1.1.1.1 activate 
vyos(config-router-af)# neighbor 10.200.0.91 activate 
vyos(config-router-af)# exit
vyos(config-router)# exit
vyos(config)# exit
vyos# show run 
Building configuration...

Current configuration:
!
frr version 10.5.2
frr defaults traditional
hostname localhost
log syslog notifications
log timestamp precision 3
no log unique-id
hostname vyos
service integrated-vtysh-config
!
router bgp 123
 neighbor 1.1.1.1 remote-as 555
 neighbor 1.1.1.1 local-as 555
 neighbor 10.200.0.91 remote-as 65528
 neighbor 10.200.0.91 local-as 65528 no-prepend replace-as
exit
!
end

I think this should be removed, as I see valid use cases for this.

I can file a PR if this change is approved.

Details

Version
2026.03.29-0031-rolling
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)