From 13f99beada6ac28ede7c74d434b84a63bf9905b0 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Wed, 19 Feb 2025 15:19:09 +0000 Subject: 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 --- data/config-mode-dependencies/vyos-vpp.json | 8 ++++++++ data/templates/vpp/startup.conf.j2 | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'data') diff --git a/data/config-mode-dependencies/vyos-vpp.json b/data/config-mode-dependencies/vyos-vpp.json index 04dc4a771..50e465e80 100644 --- a/data/config-mode-dependencies/vyos-vpp.json +++ b/data/config-mode-dependencies/vyos-vpp.json @@ -10,34 +10,42 @@ "vpp_interfaces_loopback": ["vpp_interfaces_loopback"], "vpp_interfaces_vxlan": ["vpp_interfaces_vxlan"], "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_nat_source": ["vpp_nat_source"], "vpp_kernel_interface": ["vpp_kernel-interfaces"] }, "vpp_interfaces_bonding": { "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_nat_source": ["vpp_nat_source"], "vpp_kernel_interface": ["vpp_kernel-interfaces"] }, "vpp_interfaces_ethernet": { "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_nat_source": ["vpp_nat_source"], "vpp_kernel_interface": ["vpp_kernel-interfaces"] }, "vpp_interfaces_geneve": { "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_nat_source": ["vpp_nat_source"], "vpp_kernel_interface": ["vpp_kernel-interfaces"] }, "vpp_interfaces_gre": { "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_nat_source": ["vpp_nat_source"], "vpp_kernel_interface": ["vpp_kernel-interfaces"] }, "vpp_interfaces_ipip": { "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_nat_source": ["vpp_nat_source"], "vpp_kernel_interface": ["vpp_kernel-interfaces"] }, "vpp_interfaces_loopback": { + "vpp_nat_source": ["vpp_nat_source"], "vpp_kernel_interface": ["vpp_kernel-interfaces"] }, "vpp_interfaces_vxlan": { "vpp_interfaces_bridge": ["vpp_interfaces_bridge"], "vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"], + "vpp_nat_source": ["vpp_nat_source"], "vpp_kernel_interface": ["vpp_kernel-interfaces"] } } diff --git a/data/templates/vpp/startup.conf.j2 b/data/templates/vpp/startup.conf.j2 index cf10b6ce5..c3bfc2b51 100644 --- a/data/templates/vpp/startup.conf.j2 +++ b/data/templates/vpp/startup.conf.j2 @@ -94,8 +94,8 @@ plugins { plugin pppoe_plugin.so { enable } # NAT uncomment if needed # plugin cnat_plugin.so { enable } - # plugin nat_plugin.so { enable } - # plugin nat44_plugin.so { enable } + plugin nat_plugin.so { enable } + plugin nat44_ei_plugin.so { enable } # plugin nat44_ei_plugin.so { enable } # plugin nat64_plugin.so { enable } # plugin nat66_plugin.so { enable } -- cgit v1.2.3