summaryrefslogtreecommitdiff
path: root/interface-definitions
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2025-02-19 15:19:09 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2025-02-20 14:06:28 +0000
commit13f99beada6ac28ede7c74d434b84a63bf9905b0 (patch)
tree740fcbe00148bb76e1edf90606d654f15e14c784 /interface-definitions
parent752b400aaf5520c29726dadfc94127a06e0ad5a9 (diff)
downloadvyos-1x-13f99beada6ac28ede7c74d434b84a63bf9905b0.tar.gz
vyos-1x-13f99beada6ac28ede7c74d434b84a63bf9905b0.zip
T7181: VPP add initial source NAT implentation
Add initial source NAT implementation ``` set vpp nat44 source inbound-interface 'eth2' set vpp nat44 source outbound-interface 'eth1' set vpp nat44 source translation address '192.0.2.1-192.0.2.2' ``` Add initial simple implementation of the source NAT In the future, we'll extend it to the rules if it is possible to do via VPP API
Diffstat (limited to 'interface-definitions')
-rw-r--r--interface-definitions/vpp.xml.in65
1 files changed, 65 insertions, 0 deletions
diff --git a/interface-definitions/vpp.xml.in b/interface-definitions/vpp.xml.in
index 1f1cb44cc..175b28a0b 100644
--- a/interface-definitions/vpp.xml.in
+++ b/interface-definitions/vpp.xml.in
@@ -833,6 +833,71 @@
</node>
</children>
</node>
+ <node name="nat44">
+ <properties>
+ <help>NAT44</help>
+ </properties>
+ <children>
+ <node name="source" owner="${vyos_conf_scripts_dir}/vpp_nat_source.py">
+ <properties>
+ <help>Source NAT setting</help>
+ <priority>320</priority>
+ </properties>
+ <children>
+ <leafNode name="inbound-interface">
+ <properties>
+ <help>Inbound interface of NAT traffic</help>
+ <completionHelp>
+ <list>any</list>
+ <script>${vyos_completion_dir}/list_interfaces</script>
+ </completionHelp>
+ </properties>
+ </leafNode>
+ <leafNode name="outbound-interface">
+ <properties>
+ <help>Outbound interface of NAT traffic</help>
+ <completionHelp>
+ <list>any</list>
+ <script>${vyos_completion_dir}/list_interfaces</script>
+ </completionHelp>
+ </properties>
+ </leafNode>
+ <node name="translation">
+ <properties>
+ <help>Outside NAT IP (source NAT only)</help>
+ </properties>
+ <children>
+ <leafNode name="address">
+ <properties>
+ <help>IP address, subnet, or range</help>
+ <completionHelp>
+ <list>masquerade</list>
+ </completionHelp>
+ <valueHelp>
+ <format>ipv4</format>
+ <description>IPv4 address to match</description>
+ </valueHelp>
+ <valueHelp>
+ <format>ipv4range</format>
+ <description>IPv4 address range to match</description>
+ </valueHelp>
+ <valueHelp>
+ <format>masquerade</format>
+ <description>NAT to the primary address of outbound-interface</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv4-address"/>
+ <validator name="ipv4-range"/>
+ <regex>(masquerade)</regex>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+ </node>
+ </children>
+ </node>
<tagNode name="kernel-interfaces" owner="${vyos_conf_scripts_dir}/vpp_kernel-interfaces.py">
<properties>
<help>VPP kernel interface settings</help>