Page MenuHomeVyOS Platform

Allow BGP neighbors between different VIFs on the same VyOS
Closed, ResolvedPublic

Description

I noticed that I can't be a BGP peer between different VRFs on the same VyOS 1.4.

An error will occur at commit with the following config:

set vrf name R1 table '1001'
set vrf name R5 table '1005'
set interfaces ethernet eth1 vif 915 address '192.168.15.1/24'
set interfaces ethernet eth1 vif 915 vrf 'R1'
set interfaces ethernet eth2 vif 915 address '192.168.15.5/24'
set interfaces ethernet eth2 vif 915 vrf 'R5'
set vrf name R1 protocols bgp local-as '65001'
set vrf name R1 protocols bgp neighbor 192.168.15.5 address-family ipv4-unicast
set vrf name R1 protocols bgp neighbor 192.168.15.5 remote-as '65005'
set vrf name R1 protocols bgp parameters router-id '1.1.1.1'
set vrf name R5 protocols bgp address-family ipv4-unicast network 10.5.0.0/24
set vrf name R5 protocols bgp local-as '65005'
set vrf name R5 protocols bgp neighbor 192.168.15.1 address-family ipv4-unicast
set vrf name R5 protocols bgp neighbor 192.168.15.1 remote-as '65001'
set vrf name R5 protocols bgp parameters router-id '5.5.5.5'
vyos@VyOS1# commit

Can not configure a local address as neighbor "192.168.15.5"

[[vrf name R1 protocols bgp]] failed
Commit failed
[edit]
vyos@VyOS1#

As a workaround, I did the following:

vyos@VyOS1:~$ sudo vi /usr/libexec/vyos/conf_mode/protocols_bgp.py


                # Only checks for ipv4 and ipv6 neighbors
                # Check if neighbor address is assigned as system interface address
                if is_ip(peer) and is_addr_assigned(peer):
                    #raise ConfigError(f'Can not configure a local address as neighbor "{peer}"') <-- Comment out
                    pass <--Insert

vyos@VyOS1:~$ reboot

I would like to ask you to correct it so that it does not become inconsistent with other functions.

Details

Difficulty level
Unknown (require assessment)
Version
1.4-rolling-202203070544
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Stricter validation
Issue type
Bug (incorrect behavior)

Event Timeline

ZettaiNonSugar created this task.
ZettaiNonSugar created this object in space S1 VyOS Public.

This check is actually needed as FRR will fail to apply the configuration if neighbor is a local IP.

We actually need to make the check VRF aware - so only if the requested neighbor address is in the same VRF as FRR is running it must error out.

c-po changed the task status from Open to In progress.Mar 26 2022, 7:53 AM
c-po claimed this task.
c-po raised the priority of this task from Wishlist to Normal.
c-po changed Is it a breaking change? from Behavior change to Stricter validation.
c-po changed Issue type from Feature (new functionality) to Bug (incorrect behavior).
c-po changed Version from 1.4 to 1.4-rolling-202203070544.