Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frr won't load different bgp config with different asn in different vrf #9537

Closed
WenceyWang opened this issue Sep 1, 2021 · 11 comments · Fixed by #16159
Closed

Frr won't load different bgp config with different asn in different vrf #9537

WenceyWang opened this issue Sep 1, 2021 · 11 comments · Fixed by #16159

Comments

@WenceyWang
Copy link


Describe the bug

While using different asn in BGP in different vrf, the configuration will not load correctly as the BGP after the first in the config file will be ignored and still use the first asn and drop all the configuration.

[X] Did you check if this is a duplicate issue?
[ ] Did you test it on the latest FRRouting/frr master branch?

To Reproduce

Config like

...
!
router bgp 65026
 no bgp ebgp-requires-policy
 no bgp default ipv4-unicast
 bgp confederation identifier 205532
 ...
!
router bgp 205532 vrf UpStream
 no bgp ebgp-requires-policy
 no bgp default ipv4-unicast
 ...
!

write memory
exit vtysh
service frr restart
vtysh
show run
and then check the output

!
router bgp 65026
 no bgp ebgp-requires-policy
 no bgp default ipv4-unicast
!
router bgp 65026 vrf UpStream
!

Expected behavior
The config is loaded correctly and service running correctly.

Screenshots

Versions

  • OS Version:
>cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.15.0_alpha20210804
PRETTY_NAME="Alpine Linux edge"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"
  • Kernel:
>uname -a
Linux ga-router 5.10.60-0-lts #1-Alpine SMP Thu, 19 Aug 2021 08:33:31 +0000 x86_64 Linux
  • FRR Version: 7.5.1

Additional context
I can actually run service frr reload to workaround this thing but if bgpd is being restarted, it will not load config correctly.

@WenceyWang WenceyWang added the triage Needs further investigation label Sep 1, 2021
@idryzhov
Copy link
Contributor

idryzhov commented Sep 2, 2021

I can't reproduce it on both 7.5.1 and master.

@WenceyWang
Copy link
Author

I can't reproduce it on both 7.5.1 and master.

Here is my full config, which may help, or if I can provide something else?
/etc/network/interfaces : https://pastebin.com/N8LVmFvj
/etc/frr/frr.conf : https://pastebin.com/c4ttXwuq

And as I install frr by the using the apt, the pkg manager for alpine linux.
The package is at https://pkgs.alpinelinux.org/package/edge/community/x86/frr
the build log is at https://build.alpinelinux.org/buildlogs/build-edge-x86/community/frr/frr-7.5.1-r1.log

And then I have noticed there are some patches like this:
https://git.alpinelinux.org/aports/tree/community/frr/allow-invalid-nlri-attributes.patch

Should I do something else that may help?

@ton31337 ton31337 added the bgp label Sep 14, 2021
@idryzhov
Copy link
Contributor

The problem is reproducible with the full config.
When you enter import vrf Hanataba inside the default VRF router config, it automatically creates the router config for vrf Hanataba with the same AS number.
I believe it's just not possible right now to configure multiple VRFs with different ASNs and use import/export between them.

@idryzhov idryzhov added bug and removed triage Needs further investigation labels Sep 29, 2021
@github-actions
Copy link

github-actions bot commented Jul 8, 2022

This issue is stale because it has been open 180 days with no activity. Comment or remove the autoclose label in order to avoid having this issue closed.

@frrbot
Copy link

frrbot bot commented Jul 8, 2022

This issue will be automatically closed in the specified period unless there is further activity.

@WenceyWang
Copy link
Author

This issue will be automatically closed in the specified period unless there is further activity.

I don't think it's good to just close a reproducible bug just for inactivity.

@frrbot
Copy link

frrbot bot commented Jul 10, 2022

This issue will no longer be automatically closed.

@frrbot frrbot bot removed the autoclose label Jul 10, 2022
@github-actions
Copy link

github-actions bot commented Jan 7, 2023

This issue is stale because it has been open 180 days with no activity. Comment or remove the autoclose label in order to avoid having this issue closed.

@frrbot
Copy link

frrbot bot commented Jan 7, 2023

This issue will be automatically closed in the specified period unless there is further activity.

@WenceyWang
Copy link
Author

This issue will be automatically closed in the specified period unless there is further activity.

Again, I don't think it's reasonable to just close a reproducible bug just for inactivity.

@frrbot frrbot bot removed the autoclose label Jan 7, 2023
@frrbot
Copy link

frrbot bot commented Jan 7, 2023

This issue will no longer be automatically closed.

ton31337 added a commit to opensourcerouting/frr that referenced this issue Jun 4, 2024
Configuration:

```
vtysh <<EOF
configure

vrf vrf100
 vni 10100
exit-vrf

router bgp 50
 address-family l2vpn evpn
  advertise-all-vni
 exit-address-family
exit

router bgp 100 vrf vrf100
exit
EOF
```

TL;DR; When we configure `advertise-all-vni` (in this case), a new BGP instance
is created with the name vrf100, and ASN 50. Next, when we create
`router bgp 100 vrf vrf100`, we look for the BGP instance with the same name
and we found it, but ASNs are different 50 vs. 100.

Every such a new auto created instance is flagged with BGP_VRF_AUTO.

After the fix:

```
router bgp 50
 !
 address-family l2vpn evpn
  advertise-all-vni
 exit-address-family
exit
!
router bgp 100 vrf vrf100
exit
!
end
donatas.net(config)# router bgp 51
BGP is already running; AS is 50
donatas.net(config)# router bgp 50
donatas.net(config-router)# router bgp 101 vrf vrf100
BGP is already running; AS is 100
donatas.net(config)# router bgp 100 vrf vrf100
donatas.net(config-router)#
```

Fixes: FRRouting#16152
Fixes: FRRouting#9537

Signed-off-by: Donatas Abraitis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants