Skip to content

Ensure Router Advertisements are disabled on renumber_topo as well as existing mgmt interface#25065

Merged
anders-nexthop merged 1 commit into
masterfrom
dev/matthoffman/fix-ra-on-ptf-conf
Jun 12, 2026
Merged

Ensure Router Advertisements are disabled on renumber_topo as well as existing mgmt interface#25065
anders-nexthop merged 1 commit into
masterfrom
dev/matthoffman/fix-ra-on-ptf-conf

Conversation

@mdhoff-ms

Copy link
Copy Markdown
Contributor

… pre-existing

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605

Approach

What is the motivation for this PR?

We noticed that some PTF containers had accept_ra=1 on nightly tests, causing a bad route to be discovered and the DUT becoming unreachable. Currently the accept_ra is only applied to default template interface during add_topo.yml. The proposed fix is to ensure accept_ra is forced to 0 in all additional scenarios:

  1. after interface is configured and set up, should explicitly set mgmt.accept_ra=0
  2. on renumber_topo.yml, since this may be run without add_topo.

How did you do it?

Added sysctl calls in the appropriate place in accept_topo.yml and renumber_topo.yml. For renumber_topo, we duplicate the default.accept_ra=0 that was pre-existing in add_topo and to both we also add an explicit set of mgmt.accept_ra=0 if the interface exists.

How did you verify/test it?

testbed-cli was used to remove, add and renumber the topology. The value of net.ipv6.conf.mgmt.accept_ra was checked after this and it was set correctly to 0, and the bad route did not appear.

Any platform specific information?

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

Documentation

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 3, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: mdhoff-ms / name: Matt Hoffman (582749f)

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

… pre-existing

Signed-off-by: Matt Hoffman <matthoffman@microsoft.com>
@mdhoff-ms mdhoff-ms force-pushed the dev/matthoffman/fix-ra-on-ptf-conf branch from 19e7253 to 582749f Compare June 3, 2026 01:21
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld added the Request for 202511 branch Request to backport a change to 202511 branch label Jun 3, 2026
@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request for branch(es): 202511.
Added label(s) for branch(es) 202511.

---Powered by SONiC BuildBot

@anders-nexthop anders-nexthop left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed what this closes: add_topo.yml already disabled RA on the PTF container (net.ipv6.conf.default.accept_ra=0, its line 194), but renumber_topo.yml didn't — so a renumbered testbed's PTF could still pick up router advertisements. This adds the missing default.accept_ra=0 to renumber and a per-interface mgmt.accept_ra=0 guard to both. Looks correct — one note inline on why the default + per-interface split is the right idiom.

— anders-bot (AI-assisted, on behalf of @anders-nexthop)

become: yes

- name: Don't accept ipv6 router advertisements for docker container ptf_{{ vm_set_name }}
command: docker exec -i ptf_{{ vm_set_name }} sysctl -w net.ipv6.conf.default.accept_ra=0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good split: setting default.accept_ra=0 here — before the data/vlan interfaces are created (create_dut_port/bind/renumber below) — means those interfaces inherit it, since net.ipv6.conf.default.* only seeds interfaces brought up afterward. The mgmt interface already exists by this point, so default wouldn't cover it; that's why the explicit per-interface net.ipv6.conf.mgmt.accept_ra=0 task is needed (with the test -e guard for topos that have no mgmt interface). Matches add_topo.yml:194.

@anders-nexthop anders-nexthop merged commit 5c8a00b into master Jun 12, 2026
27 checks passed
sdeotarse-msft pushed a commit to SoumyaMishra18/sonic-mgmt that referenced this pull request Jun 12, 2026
… existing mgmt interface (sonic-net#25065)

… pre-existing

<!--
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 # (issue)

### Type of change

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

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


### Back port request
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [x] 202511
- [ ] 202512
- [ ] 202605

### Approach
#### What is the motivation for this PR?
We noticed that some PTF containers had accept_ra=1 on nightly tests,
causing a bad route to be discovered and the DUT becoming unreachable.
Currently the accept_ra is only applied to default template interface
during add_topo.yml. The proposed fix is to ensure accept_ra is forced
to 0 in all additional scenarios:

1. after interface is configured and set up, should explicitly set
mgmt.accept_ra=0
2. on renumber_topo.yml, since this may be run without add_topo.

#### How did you do it?
Added sysctl calls in the appropriate place in accept_topo.yml and
renumber_topo.yml. For renumber_topo, we duplicate the
default.accept_ra=0 that was pre-existing in add_topo and to both we
also add an explicit set of mgmt.accept_ra=0 if the interface exists.

#### How did you verify/test it?
testbed-cli was used to remove, add and renumber the topology. The value
of net.ipv6.conf.mgmt.accept_ra was checked after this and it was set
correctly to 0, and the bad route did not appear.

#### 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?
-->

Signed-off-by: Matt Hoffman <matthoffman@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Request for 202511 branch Request to backport a change to 202511 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants