diff options
| author | Nataliia Solomko <natalirs1985@gmail.com> | 2025-10-23 13:21:57 +0300 |
|---|---|---|
| committer | Nataliia Solomko <natalirs1985@gmail.com> | 2025-10-23 13:22:57 +0300 |
| commit | 3b6f7ea3406a22dcc6fd4bb50b1febfac7eab907 (patch) | |
| tree | 692a6c425b822aa750ff79d81cb35a712ee200e7 /python | |
| parent | d272b2509836403682c6c8ab4096ccf4be003bcb (diff) | |
| download | vyos-1x-3b6f7ea3406a22dcc6fd4bb50b1febfac7eab907.tar.gz vyos-1x-3b6f7ea3406a22dcc6fd4bb50b1febfac7eab907.zip | |
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) |
