diff options
Diffstat (limited to 'templates-cfg/nat/nptv6/rule/node.tag/outbound-interface/node.def')
-rw-r--r-- | templates-cfg/nat/nptv6/rule/node.tag/outbound-interface/node.def | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/templates-cfg/nat/nptv6/rule/node.tag/outbound-interface/node.def b/templates-cfg/nat/nptv6/rule/node.tag/outbound-interface/node.def new file mode 100644 index 0000000..f7bf286 --- /dev/null +++ b/templates-cfg/nat/nptv6/rule/node.tag/outbound-interface/node.def @@ -0,0 +1,30 @@ +type: txt + +help: Outbound 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+ vxlan+ vti+ l2tpeth+\" + 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 " |