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 /op-mode-definitions | |
| 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 'op-mode-definitions')
| -rw-r--r-- | op-mode-definitions/vpp_nat_cgnat.xml.in | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/op-mode-definitions/vpp_nat_cgnat.xml.in b/op-mode-definitions/vpp_nat_cgnat.xml.in new file mode 100644 index 000000000..8af10711f --- /dev/null +++ b/op-mode-definitions/vpp_nat_cgnat.xml.in @@ -0,0 +1,100 @@ +<?xml version="1.0"?> +<interfaceDefinition> + <node name="show"> + <children> + <node name="vpp"> + <children> + <node name="nat"> + <properties> + <help>Show VPP NAT information</help> + </properties> + <children> + <node name="cgnat"> + <properties> + <help>Show VPP CGNAT information</help> + </properties> + <children> + <node name="mappings"> + <properties> + <help>Show VPP CGNAT mappings</help> + </properties> + <command>sudo ${vyos_op_scripts_dir}/vpp_nat_cgnat.py show_mappings</command> + </node> + <node name="sessions"> + <properties> + <help>Show VPP CGNAT sessions</help> + </properties> + <command>sudo ${vyos_op_scripts_dir}/vpp_nat_cgnat.py show_sessions</command> + </node> + <node name="interfaces"> + <properties> + <help>Show VPP CGNAT interfaces</help> + </properties> + <command>sudo ${vyos_op_scripts_dir}/vpp_nat_cgnat.py show_interfaces</command> + </node> + </children> + </node> + </children> + </node> + </children> + </node> + </children> + </node> + <node name="clear"> + <children> + <node name="vpp"> + <properties> + <help>Terminate VPP NAT sessions</help> + </properties> + <children> + <node name="cgnat"> + <properties> + <help>Terminate VPP CGNAT sessions</help> + </properties> + <children> + <tagNode name="inside-address"> + <properties> + <help>Inside IP address</help> + <completionHelp> + <list><x.x.x.x></list> + </completionHelp> + </properties> + <children> + <tagNode name="port"> + <properties> + <help>Port</help> + <completionHelp> + <list>0-65535</list> + </completionHelp> + </properties> + <children> + <tagNode name="external-address"> + <properties> + <help>External IP address</help> + <completionHelp> + <list><x.x.x.x></list> + </completionHelp> + </properties> + <children> + <tagNode name="port"> + <properties> + <help>Port</help> + <completionHelp> + <list>0-65535</list> + </completionHelp> + </properties> + <command>sudo ${vyos_op_scripts_dir}/vpp_nat_cgnat.py clear_session --address $5 --port $7 --ext-address $9 --ext-port ${11}</command> + </tagNode> + </children> + </tagNode> + </children> + </tagNode> + </children> + </tagNode> + </children> + </node> + </children> + </node> + </children> + </node> +</interfaceDefinition> |
