diff options
| author | Nataliia Solomko <natalirs1985@gmail.com> | 2025-11-28 16:30:41 +0200 |
|---|---|---|
| committer | Nataliia Solomko <natalirs1985@gmail.com> | 2025-12-04 16:47:30 +0200 |
| commit | e091fb8bd87da8c9cd56f3435b39134b917a57a2 (patch) | |
| tree | 7301f3442e7c529509c9c74b38f73be1d3cc71d5 /src/migration-scripts/vpp | |
| parent | 81eb7510621b3aa478359117733204bc7f140931 (diff) | |
| download | vyos-1x-e091fb8bd87da8c9cd56f3435b39134b917a57a2.tar.gz vyos-1x-e091fb8bd87da8c9cd56f3435b39134b917a57a2.zip | |
vpp: T7972: Make `nat44 no-forwarding` feature automatically configurable
If any dynamic rule is configured forwarding should be disabled because each
packet must be processed through the NAT session table to apply proper
translations
Diffstat (limited to 'src/migration-scripts/vpp')
| -rw-r--r-- | src/migration-scripts/vpp/3-to-4 | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/migration-scripts/vpp/3-to-4 b/src/migration-scripts/vpp/3-to-4 new file mode 100644 index 000000000..8c79299f5 --- /dev/null +++ b/src/migration-scripts/vpp/3-to-4 @@ -0,0 +1,30 @@ +# Copyright VyOS maintainers and contributors <maintainers@vyos.io> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library. If not, see <http://www.gnu.org/licenses/>. + +# Delete 'vpp settings nat44 no-forwarding' +# because it will be set automatically (T7972) + + +from vyos.configtree import ConfigTree + +base = ['vpp', 'settings', 'nat44'] + +def migrate(config: ConfigTree) -> None: + + if config.exists(base + ['no-forwarding']): + # Delete no-forwarding option from NAT44 settings + config.delete(base + ['no-forwarding']) + if config.exists(base) and len(config.list_nodes(base)) == 0: + config.delete(base) |
