summaryrefslogtreecommitdiff
path: root/interface-definitions/nat.xml.in
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-05-16 18:36:13 +0200
committerChristian Poessinger <christian@poessinger.com>2020-05-16 18:36:13 +0200
commit9e305400f281a1ce558aab692f44426da0d76bcc (patch)
tree1dd977c169415b71297b17df0d8f012543fc042a /interface-definitions/nat.xml.in
parent02ee6b7bf1bcb0a6d55b3d02496d2f501e622ea2 (diff)
parent2ba8c8499f8664b69bb9b48268f7c5cd5b06cd89 (diff)
downloadvyos-1x-9e305400f281a1ce558aab692f44426da0d76bcc.tar.gz
vyos-1x-9e305400f281a1ce558aab692f44426da0d76bcc.zip
Merge branch 'nat-nftables' of github.com:c-po/vyos-1x into current
* 'nat-nftables' of github.com:c-po/vyos-1x: (27 commits) nat: T2198: remove "tcp_udp" from "show nat dest stat"x Debian: add required dependency on systemd nat: T2198: add common ip-protocol validator nat: T2198: use Jinja2 macro for common ruleset for SNAT and DNAT nat: T2198: restructure DNAT template part for less duplicated code nat: T2198: add support for SNAT based on source addresses nat: T2198: set default protocol to all to be backwards compatible nat: T2198: sync generated SNAT rules with VyOS 1.2 nat: T2198: sync generated DNAT rules with VyOS 1.2 nat: T2198: do not run DNAT rule if rule is disabled nat: T2198: restructure DNAT template nat: T2198: verify translation address for SNAT and DNAT nat: T2198: extend verify() for destination ports nat: T2198: migrate "log enable" node to only "log" nat: T2198: add protocol completion helper and regex constraint nat: T2198: migrate "show nat" commands to XML and Python nat: T2198: add some basic verify() rules nat: T2198: split nat-address-port include into individual files nat: T2198: add ipv4-{address,prefix,rage}-exclude validators nat: T2198: add new ipv4-range validator ...
Diffstat (limited to 'interface-definitions/nat.xml.in')
-rw-r--r--interface-definitions/nat.xml.in115
1 files changed, 115 insertions, 0 deletions
diff --git a/interface-definitions/nat.xml.in b/interface-definitions/nat.xml.in
new file mode 100644
index 000000000..af9dd1eff
--- /dev/null
+++ b/interface-definitions/nat.xml.in
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="nat" owner="sudo ${vyos_conf_scripts_dir}/nat.py">
+ <properties>
+ <help>Network Address Translation (NAT) parameters</help>
+ <priority>220</priority>
+ </properties>
+ <children>
+ <node name="destination">
+ <properties>
+ <help>Destination NAT settings</help>
+ </properties>
+ <children>
+ #include <include/nat-rule.xml.i>
+ <tagNode name="rule">
+ <children>
+ <leafNode name="inbound-interface">
+ <properties>
+ <help>Inbound interface of NAT traffic</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py</script>
+ </completionHelp>
+ </properties>
+ </leafNode>
+ <node name="translation">
+ <properties>
+ <help>Inside NAT IP (destination NAT only)</help>
+ </properties>
+ <children>
+ <leafNode name="address">
+ <properties>
+ <help>IP address, subnet, or range</help>
+ <valueHelp>
+ <format>ipv4</format>
+ <description>IPv4 address to match</description>
+ </valueHelp>
+ <valueHelp>
+ <format>ipv4net</format>
+ <description>IPv4 prefix to match</description>
+ </valueHelp>
+ <valueHelp>
+ <format>ipv4range</format>
+ <description>IPv4 address range to match</description>
+ </valueHelp>
+ <!-- TODO: add general iptables constraint script -->
+ </properties>
+ </leafNode>
+ #include <include/nat-translation-port.xml.i>
+ </children>
+ </node>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ <node name="source">
+ <properties>
+ <help>Source NAT settings</help>
+ </properties>
+ <children>
+ #include <include/nat-rule.xml.i>
+ <tagNode name="rule">
+ <children>
+ <leafNode name="outbound-interface">
+ <properties>
+ <help>Outbound interface of NAT traffic</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py</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>ipv4net</format>
+ <description>IPv4 prefix 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-prefix"/>
+ <validator name="ipv4-address"/>
+ <validator name="ipv4-range"/>
+ <regex>(masquerade)</regex>
+ </constraint>
+ </properties>
+ </leafNode>
+ #include <include/nat-translation-port.xml.i>
+ </children>
+ </node>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>