Skip to content

[bgp] Fix the error from mixed internal and external member in bgp peer-group#22022

Open
byu343 wants to merge 1 commit intosonic-net:masterfrom
byu343:internal-bgp
Open

[bgp] Fix the error from mixed internal and external member in bgp peer-group#22022
byu343 wants to merge 1 commit intosonic-net:masterfrom
byu343:internal-bgp

Conversation

@byu343
Copy link
Contributor

@byu343 byu343 commented Mar 12, 2025

Why I did it

The issue is seen on t0-d18u8s4. The peer switches (internal) and t1 switches (external) were added to the same BGP peer group, which is not allowed.

The error is from bgpcfgd:
Peer-group members must be all internal or all external

Work item tracking
  • Microsoft ADO (number only):

How I did it

Skip adding the internal neighbors (same ASN) to peer group.

How to verify it

Tested with sonic-mgmt topo t0-d18u8s4

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

…rnal'

The issue is seen on t0-d18u8s4. The peer switches (internal) and t1 switches
(external) were added to the same BGP peer group, which is not allowed.

The error is from bgpcfgd:
Peer-group members must be all internal or all external

Skip adding the internal neighbors (same ASN) to peer group.
@byu343 byu343 requested a review from lguohan as a code owner March 12, 2025 23:45
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@r12f
Copy link
Contributor

r12f commented Apr 2, 2025

hi @byu343 , in this case, should we fix the topology? it sounds like a topology issue.

@byu343
Copy link
Contributor Author

byu343 commented Apr 2, 2025

hi @byu343 , in this case, should we fix the topology? it sounds like a topology issue.

Hi @r12f That may be possible. The topo used is t0-d18u8s4. Do you think changing the ASN of peer device so that they are not no longer internal bgp peers (https://github.com/sonic-net/sonic-mgmt/blob/master/ansible/vars/topo_t0-d18u8s4.yml#L381) or you have some other ideas?

@r12f
Copy link
Contributor

r12f commented Apr 3, 2025

@sdszhang we need to update the topology to use 4-bytes for the PT0 VMs.

  ARISTA04PT0:
    properties:
    - common
    bgp:
      asn: 65100
      peers:
        65100:
        - 10.0.0.162
        - FC00::17D

mssonicbld added a commit to mssonicbld/sonic-mgmt.msft that referenced this pull request Apr 13, 2025
<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:
Fixes same issue in [#22022](sonic-net/sonic-buildimage#22022) by updating the peer T0's ASN to 4 bytes ASN number.

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
    - [ ] Skipped for non-supported platforms
- [ ] Test case improvement

### Back port request
- [ ] 202012
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411

### Approach
#### What is the motivation for this PR?
Fix topo error.

#### How did you do it?

#### How did you verify/test it?

```
admin@sonic:~$ show ip bgp summary

IPv4 Unicast Summary:
BGP router identifier 10.1.0.32, local AS number 65100 vrf-id 0
BGP table version 2
RIB entries 3, using 672 bytes of memory
Peers 12, using 8903712 KiB of memory
Peer groups 5, using 320 bytes of memory

Neighbhor      V          AS    MsgRcvd    MsgSent    TblVer    InQ    OutQ  Up/Down    State/PfxRcd    NeighborName
-----------  ---  ----------  ---------  ---------  --------  -----  ------  ---------  --------------  --------------
10.0.0.57      4       64600          0          0         0      0       0  never      Active          ARISTA01T1
10.0.0.59      4       64600          0          0         0      0       0  never      Active          ARISTA02T1
10.0.0.61      4       64600          0          0         0      0       0  never      Active          ARISTA03T1
10.0.0.63      4       64600          0          0         0      0       0  never      Active          ARISTA04T1
10.0.0.65      4       64600          0          0         0      0       0  never      Active          ARISTA05T1
10.0.0.67      4       64600          0          0         0      0       0  never      Active          ARISTA06T1
10.0.0.69      4       64600          0          0         0      0       0  never      Active          ARISTA07T1
10.0.0.71      4       64600          0          0         0      0       0  never      Active          ARISTA08T1
10.0.0.157     4  4200000000          0          0         0      0       0  never      Active          ARISTA01PT0
10.0.0.159     4  4200000001          0          0         0      0       0  never      Active          ARISTA02PT0
10.0.0.161     4  4200000002          0          0         0      0       0  never      Active          ARISTA03PT0
10.0.0.163     4  4200000003          0          0         0      0       0  never      Active          ARISTA04PT0

Total number of neighbors 12
admin@sonic:~$ show ipv6 bgp summary

IPv6 Unicast Summary:
BGP router identifier 10.1.0.32, local AS number 65100 vrf-id 0
BGP table version 2
RIB entries 3, using 672 bytes of memory
Peers 12, using 8903712 KiB of memory
Peer groups 5, using 320 bytes of memory

Neighbhor      V          AS    MsgRcvd    MsgSent    TblVer    InQ    OutQ  Up/Down    State/PfxRcd    NeighborName
-----------  ---  ----------  ---------  ---------  --------  -----  ------  ---------  --------------  --------------
fc00::7a       4       64600          0          0         0      0       0  never      Active          ARISTA03T1
fc00::7e       4       64600          0          0         0      0       0  never      Active          ARISTA04T1
fc00::8a       4       64600          0          0         0      0       0  never      Active          ARISTA07T1
fc00::8e       4       64600          0          0         0      0       0  never      Active          ARISTA08T1
fc00::17a      4  4200000002          0          0         0      0       0  never      Active          ARISTA03PT0
fc00::17e      4  4200000003          0          0         0      0       0  never      Active          ARISTA04PT0
fc00::72       4       64600          0          0         0      0       0  never      Active          ARISTA01T1
fc00::76       4       64600          0          0         0      0       0  never      Active          ARISTA02T1
fc00::82       4       64600          0          0         0      0       0  never      Active          ARISTA05T1
fc00::86       4       64600          0          0         0      0       0  never      Active          ARISTA06T1
fc00::172      4  4200000000          0          0         0      0       0  never      Active          ARISTA01PT0
fc00::176      4  4200000001          0          0         0      0       0  never      Active          ARISTA02PT0

Total number of neighbors 12
admin@sonic:~$
```

#### Any platform specific information?

#### Supported testbed topology if it's a new test case?

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
mssonicbld added a commit to Azure/sonic-mgmt.msft that referenced this pull request Apr 14, 2025
<!--
Please make sure you've read and understood our contributing guidelines;
https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md

Please provide following information to help code review process a bit easier:
-->
### Description of PR
<!--
- Please include a summary of the change and which issue is fixed.
- Please also include relevant motivation and context. Where should reviewer start? background context?
- List any dependencies that are required for this change.
-->

Summary:
Fixes same issue in [#22022](sonic-net/sonic-buildimage#22022) by updating the peer T0's ASN to 4 bytes ASN number.

### Type of change

<!--
- Fill x for your type of change.
- e.g.
- [x] Bug fix
-->

- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
 - [ ] Skipped for non-supported platforms
- [ ] Test case improvement

### Back port request
- [ ] 202012
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411

### Approach
#### What is the motivation for this PR?
Fix topo error.

#### How did you do it?

#### How did you verify/test it?

```
admin@sonic:~$ show ip bgp summary

IPv4 Unicast Summary:
BGP router identifier 10.1.0.32, local AS number 65100 vrf-id 0
BGP table version 2
RIB entries 3, using 672 bytes of memory
Peers 12, using 8903712 KiB of memory
Peer groups 5, using 320 bytes of memory

Neighbhor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd NeighborName
----------- --- ---------- --------- --------- -------- ----- ------ --------- -------------- --------------
10.0.0.57 4 64600 0 0 0 0 0 never Active ARISTA01T1
10.0.0.59 4 64600 0 0 0 0 0 never Active ARISTA02T1
10.0.0.61 4 64600 0 0 0 0 0 never Active ARISTA03T1
10.0.0.63 4 64600 0 0 0 0 0 never Active ARISTA04T1
10.0.0.65 4 64600 0 0 0 0 0 never Active ARISTA05T1
10.0.0.67 4 64600 0 0 0 0 0 never Active ARISTA06T1
10.0.0.69 4 64600 0 0 0 0 0 never Active ARISTA07T1
10.0.0.71 4 64600 0 0 0 0 0 never Active ARISTA08T1
10.0.0.157 4 4200000000 0 0 0 0 0 never Active ARISTA01PT0
10.0.0.159 4 4200000001 0 0 0 0 0 never Active ARISTA02PT0
10.0.0.161 4 4200000002 0 0 0 0 0 never Active ARISTA03PT0
10.0.0.163 4 4200000003 0 0 0 0 0 never Active ARISTA04PT0

Total number of neighbors 12
admin@sonic:~$ show ipv6 bgp summary

IPv6 Unicast Summary:
BGP router identifier 10.1.0.32, local AS number 65100 vrf-id 0
BGP table version 2
RIB entries 3, using 672 bytes of memory
Peers 12, using 8903712 KiB of memory
Peer groups 5, using 320 bytes of memory

Neighbhor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd NeighborName
----------- --- ---------- --------- --------- -------- ----- ------ --------- -------------- --------------
fc00::7a 4 64600 0 0 0 0 0 never Active ARISTA03T1
fc00::7e 4 64600 0 0 0 0 0 never Active ARISTA04T1
fc00::8a 4 64600 0 0 0 0 0 never Active ARISTA07T1
fc00::8e 4 64600 0 0 0 0 0 never Active ARISTA08T1
fc00::17a 4 4200000002 0 0 0 0 0 never Active ARISTA03PT0
fc00::17e 4 4200000003 0 0 0 0 0 never Active ARISTA04PT0
fc00::72 4 64600 0 0 0 0 0 never Active ARISTA01T1
fc00::76 4 64600 0 0 0 0 0 never Active ARISTA02T1
fc00::82 4 64600 0 0 0 0 0 never Active ARISTA05T1
fc00::86 4 64600 0 0 0 0 0 never Active ARISTA06T1
fc00::172 4 4200000000 0 0 0 0 0 never Active ARISTA01PT0
fc00::176 4 4200000001 0 0 0 0 0 never Active ARISTA02PT0

Total number of neighbors 12
admin@sonic:~$
```

#### Any platform specific information?

#### Supported testbed topology if it's a new test case?

### Documentation
<!--
(If it's a new feature, new test case)
Did you update documentation/Wiki relevant to your implementation?
Link to the wiki page?
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants