summaryrefslogtreecommitdiff
path: root/data/templates/ndppd/ndppd.conf.j2
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-05-01 20:08:28 +0200
committerChristian Poessinger <christian@poessinger.com>2022-05-01 20:08:28 +0200
commit9eab0cdd0bbea0f899af5a7d68cc63523a12a703 (patch)
treeaf51142e3b4fac35482674111a3adf62010dfd4b /data/templates/ndppd/ndppd.conf.j2
parent59290c857237912dc5cc67733622e2604f1ff30a (diff)
downloadvyos-1x-9eab0cdd0bbea0f899af5a7d68cc63523a12a703.tar.gz
vyos-1x-9eab0cdd0bbea0f899af5a7d68cc63523a12a703.zip
firewall: T4353: fix Jinja2 linting errors
Diffstat (limited to 'data/templates/ndppd/ndppd.conf.j2')
-rw-r--r--data/templates/ndppd/ndppd.conf.j244
1 files changed, 44 insertions, 0 deletions
diff --git a/data/templates/ndppd/ndppd.conf.j2 b/data/templates/ndppd/ndppd.conf.j2
new file mode 100644
index 000000000..120fa0a64
--- /dev/null
+++ b/data/templates/ndppd/ndppd.conf.j2
@@ -0,0 +1,44 @@
+########################################################
+#
+# autogenerated by nat66.py
+#
+# The configuration file must define one upstream
+# interface.
+#
+# For some services, such as nat66, because it runs
+# stateless, it needs to rely on NDP Proxy to respond
+# to NDP requests.
+#
+# When using nat66 source rules, NDP Proxy needs
+# to be enabled
+#
+########################################################
+
+{% set global = namespace(ndppd_interfaces = [],ndppd_prefixs = []) %}
+{% if source.rule is vyos_defined %}
+{% for rule, config in source.rule.items() if config.disable is not defined %}
+{% if config.outbound_interface is vyos_defined %}
+{% if config.outbound_interface not in global.ndppd_interfaces %}
+{% set global.ndppd_interfaces = global.ndppd_interfaces + [config.outbound_interface] %}
+{% endif %}
+{% if config.translation.address is vyos_defined and config.translation.address | is_ip_network %}
+{% set global.ndppd_prefixs = global.ndppd_prefixs + [{'interface':config.outbound_interface,'rule':config.translation.address}] %}
+{% endif %}
+{% endif %}
+{% endfor %}
+{% endif %}
+
+{% for interface in global.ndppd_interfaces %}
+proxy {{ interface }} {
+ router yes
+ timeout 500
+ ttl 30000
+{% for map in global.ndppd_prefixs %}
+{% if map.interface == interface %}
+ rule {{ map.rule }} {
+ static
+ }
+{% endif %}
+{% endfor %}
+}
+{% endfor %}