Skip to content

Conversation

@natali-rs1985
Copy link
Contributor

Do not allow to delete subinterface if it is in use in VPP NAT features

Change summary

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

How to test / Smoketest result

set interfaces ethernet eth1 vif 10 address 10.0.2.1/24

set vpp settings interface eth1 driver dpdk
set vpp nat cgnat interface inside eth1
set vpp nat cgnat interface outside  eth1.10
set vpp nat cgnat rule 10 inside-prefix 100.99.0.0/24
set vpp nat cgnat rule 10 outside-prefix 206.0.15.248/29
commit

del interfaces ethernet eth1 vif
commit

Before the fix:

vyos@vyos# sudo vppctl show det44 interfaces
DET44 interfaces:
 eth1 in
 DELETED (3) out
[edit]
@vyos# run show vpp nat cgnat interfaces
CGNAT interfaces:
  eth1 in
  None out
[edit]

After the fix:

vyos@vyos# commit
[ interfaces ethernet eth1 ]
Cannot delete interface "eth1.10", it is still in use by "vpp nat cgnat" as
outside interface

[[interfaces ethernet eth1]] failed
Commit failed

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

👍
No issues in PR Title / Commit Title

for vif in ethernet.get(vif_type, []):
vif_name = f'{ifname}.{vif}'

for path in ['vpp.nat44', 'vpp.nat.cgnat']:
Copy link
Member

Choose a reason for hiding this comment

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

Can we somehow extend the path or recursively check the entire VPP configuration?
There could be other places where we can find subinterfaces in the VPP config
For example:

set vpp interfaces bridge br1 member interface eth0.23
set vpp acl ip interface eth0.23
set vpp acl macip interface eth0.23
set vpp sflow interface eth0.23

I'm not against fixing this for NAT exclusively.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At the moment subinterfaces are not allowed in any of this VPP configs.

Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

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

I also feel there could be a general solution, but I'm also not against fixing it in the only already known place first.

@dmbaturin dmbaturin added the bp/circinus Create automatic backport for circinus label Nov 3, 2025
@natali-rs1985
Copy link
Contributor Author

I've made it more universal. @sever-sever @dmbaturin please check once more

…face is removed from vif

Do not allow to delete subinterface if it is in use in VPP features
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

CI integration ❌ failed!

Details

CI logs

  • CLI Smoketests (no interfaces) ❌ failed
  • CLI Smoketests VPP 👍 passed
  • CLI Smoketests (interfaces only) 👍 passed
  • Config tests 👍 passed
  • Config tests VPP 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

Copy link
Member

@sever-sever sever-sever left a comment

Choose a reason for hiding this comment

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

Do not allow the deletion of subinterfaces that are used in VPP
I did not do local tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bp/circinus Create automatic backport for circinus current rebase

Development

Successfully merging this pull request may close these issues.

3 participants