diff options
| author | Nataliia S. <81954790+natali-rs1985@users.noreply.github.com> | 2025-05-01 20:15:32 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-01 18:15:32 +0100 |
| commit | 528248af9628c3170b4eac399f0bb339072d8eae (patch) | |
| tree | 5b62b4734e42fd790f1c85ea5de350400dad1212 /src/conf_mode/vpp_nat.py | |
| parent | f4e02fdff7a7fcb42a1c5fc313e317af63cd1dcd (diff) | |
| download | vyos-1x-528248af9628c3170b4eac399f0bb339072d8eae.tar.gz vyos-1x-528248af9628c3170b4eac399f0bb339072d8eae.zip | |
T7390: VPP CGNAT implementation (#30)
CLI:
```
set vpp nat cgnat interface outside <interface> # multi
set vpp nat cgnat interface inside <interface> # multi
set vpp nat cgnat rule <rule> outside-prefix <prefix>
set vpp nat cgnat rule <rule> inside-prefix <prefix>
set vpp nat cgnat timeout udp <sec> # default 300
set vpp nat cgnat timeout tcp-established <sec> # default 7440
set vpp nat cgnat timeout tcp-transitory <sec> # default 240
set vpp nat cgnat timeout icmp <sec> # default 60
```
OP mode:
```
show vpp nat cgnat interfaces
show vpp nat cgnat mappings
show vpp nat cgnat sessions
clear vpp cgnat inside-address <address> port <port> external-address <address> port <port>
```
Diffstat (limited to 'src/conf_mode/vpp_nat.py')
| -rw-r--r-- | src/conf_mode/vpp_nat.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/conf_mode/vpp_nat.py b/src/conf_mode/vpp_nat.py index d38599388..a6bc70032 100644 --- a/src/conf_mode/vpp_nat.py +++ b/src/conf_mode/vpp_nat.py @@ -186,7 +186,11 @@ def verify(config): raise ConfigError( f'{interface} must be a VPP interface for "address-pool translation interface"' ) - iface_address = get_interface_address(interface).get('addr_info', [])[0].get('local') + iface_address = ( + get_interface_address(interface) + .get('addr_info', [])[0] + .get('local') + ) addresses_translation.append(iface_address) if 'twice_nat' in address_pool: @@ -211,7 +215,11 @@ def verify(config): raise ConfigError( f'{interface} must be a VPP interface for "address-pool twice-nat interface"' ) - iface_address = get_interface_address(interface).get('addr_info', [])[0].get('local') + iface_address = ( + get_interface_address(interface) + .get('addr_info', [])[0] + .get('local') + ) addresses_twice_nat.append(iface_address) if 'static' in config: |
