diff options
| author | Daniil Baturin <daniil@vyos.io> | 2025-11-03 14:04:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-03 14:04:08 +0000 |
| commit | 21d509d6c639f2a94c43c3af7f845ef0e544555f (patch) | |
| tree | a128edfdf0e58069cf0a465bfe2a5f7d14bd9085 /python | |
| parent | ad60030a813e8913dbf639aa449081ce1c8287d6 (diff) | |
| parent | 3b6f7ea3406a22dcc6fd4bb50b1febfac7eab907 (diff) | |
| download | vyos-1x-21d509d6c639f2a94c43c3af7f845ef0e544555f.tar.gz vyos-1x-21d509d6c639f2a94c43c3af7f845ef0e544555f.zip | |
Merge pull request #4808 from natali-rs1985/T7949
T7949: VPP add the ability to configure bond subinterfaces for NAT
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/vpp/utils.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/python/vyos/vpp/utils.py b/python/vyos/vpp/utils.py index 963423e2b..0c247e48a 100644 --- a/python/vyos/vpp/utils.py +++ b/python/vyos/vpp/utils.py @@ -48,6 +48,22 @@ def iftunnel_transform(iface: str) -> str: return f'{iface_type}_tunnel{iface_num}' +def vpp_iface_name_transform(iface: str) -> str: + """Convert a CLI interface name to its corresponding VPP interface name format + + Args: + iface (str): Interface name as used in VyOS configuration (e.g., "bond0"). + + Returns: + str: Interface name formatted as recognized by VPP (e.g., "BondEthernet0"). + """ + vpp_iface_name = iface + if vpp_iface_name.startswith('bond'): + # interface name in VPP is BondEthernetX + vpp_iface_name = vpp_iface_name.replace('bond', 'BondEthernet') + return vpp_iface_name + + def cli_ifaces_list(config_instance, mode: str = 'candidate') -> list[str]: """List of all VPP interfaces (CLI names) |
