diff options
author | kouak <kouak@kouak.org> | 2015-02-15 22:37:14 +0100 |
---|---|---|
committer | kouak <kouak@kouak.org> | 2015-02-15 22:37:14 +0100 |
commit | 9571f0e592088c49c6c16724c5124631326066fd (patch) | |
tree | 89fe54ea2a5232496e32524c4dd99f5f8ae0ee10 /templates-cfg/nat/nptv6/rule | |
parent | 9ee62f2e55cd83110c5964c020233c0c983154a0 (diff) | |
download | vyatta-nat-9571f0e592088c49c6c16724c5124631326066fd.tar.gz vyatta-nat-9571f0e592088c49c6c16724c5124631326066fd.zip |
Add initial support for NPTv6 (#387)
Diffstat (limited to 'templates-cfg/nat/nptv6/rule')
6 files changed, 59 insertions, 0 deletions
diff --git a/templates-cfg/nat/nptv6/rule/node.def b/templates-cfg/nat/nptv6/rule/node.def new file mode 100644 index 0000000..c666be9 --- /dev/null +++ b/templates-cfg/nat/nptv6/rule/node.def @@ -0,0 +1,11 @@ +tag: + +type: u32 + +help: Rule number for NAT + +syntax:expression: ($VAR(@) > 0 && $VAR(@) < 10000) ; \ + "Rule number must be between 1 and 9999." + +val_help: u32:1-9999 ; Number for this NAT rule + diff --git a/templates-cfg/nat/nptv6/rule/node.tag/description/node.def b/templates-cfg/nat/nptv6/rule/node.tag/description/node.def new file mode 100644 index 0000000..90bf88b --- /dev/null +++ b/templates-cfg/nat/nptv6/rule/node.tag/description/node.def @@ -0,0 +1,3 @@ +type: txt + +help: Rule description diff --git a/templates-cfg/nat/nptv6/rule/node.tag/disable/node.def b/templates-cfg/nat/nptv6/rule/node.tag/disable/node.def new file mode 100644 index 0000000..c23fc5a --- /dev/null +++ b/templates-cfg/nat/nptv6/rule/node.tag/disable/node.def @@ -0,0 +1 @@ +help: Disable NAT rule diff --git a/templates-cfg/nat/nptv6/rule/node.tag/inside-prefix/node.def b/templates-cfg/nat/nptv6/rule/node.tag/inside-prefix/node.def new file mode 100644 index 0000000..7af7091 --- /dev/null +++ b/templates-cfg/nat/nptv6/rule/node.tag/inside-prefix/node.def @@ -0,0 +1,7 @@ +type: txt + +help: Inside prefix to be translated + +val_help: ipv6net; IPv6 prefix to match + +syntax:expression: exec "/opt/vyatta/sbin/vyatta-validate-type ipv6_addr_param $VAR(@)" diff --git a/templates-cfg/nat/nptv6/rule/node.tag/outside-interface/node.def b/templates-cfg/nat/nptv6/rule/node.tag/outside-interface/node.def new file mode 100644 index 0000000..d0954ad --- /dev/null +++ b/templates-cfg/nat/nptv6/rule/node.tag/outside-interface/node.def @@ -0,0 +1,30 @@ +type: txt + +help: Outside interface of NPTv6 traffic + +enumeration: existing-interfaces; echo "any" + +val_help: <interface> ; Interface name or "any" + +commit:expression: exec " + if [ \"any\" == \"$VAR(@)\" ] ; then + exit 0 + fi + intf_array=($(awk '$1 ~ /:/ { print $1 }' /proc/net/dev)) + intf_array_len=${#intf_array[*]} + i=0 + while [ $i -lt $intf_array_len ]; do + temp=${intf_array[$i]%:*} + if [ \"$temp\" == \"$VAR(@)\" ] ; then + exit 0 + fi + let i++ + done + intf_group_name_array=\"eth+ bond+ br+ peth+ vtun+ tun+ wlm+ wlan+\" + i=0 + for i in $intf_group_name_array; do + if [ \"$i\" == \"$VAR(@)\" ]; then + exit 0 + fi + done + echo NPTv6 configuration warning: interface $VAR(@) does not exist on this system " diff --git a/templates-cfg/nat/nptv6/rule/node.tag/outside-prefix/node.def b/templates-cfg/nat/nptv6/rule/node.tag/outside-prefix/node.def new file mode 100644 index 0000000..7af7091 --- /dev/null +++ b/templates-cfg/nat/nptv6/rule/node.tag/outside-prefix/node.def @@ -0,0 +1,7 @@ +type: txt + +help: Inside prefix to be translated + +val_help: ipv6net; IPv6 prefix to match + +syntax:expression: exec "/opt/vyatta/sbin/vyatta-validate-type ipv6_addr_param $VAR(@)" |