From 3b6f7ea3406a22dcc6fd4bb50b1febfac7eab907 Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Thu, 23 Oct 2025 13:21:57 +0300 Subject: T7949: VPP add the ability to configure bond subinterfaces for NAT --- python/vyos/vpp/utils.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'python') 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) -- cgit v1.2.3