summaryrefslogtreecommitdiff
path: root/templates-cfg
diff options
context:
space:
mode:
authorDaniil Baturin <daniil.baturin@vyatta.com>2011-07-26 19:47:57 +0700
committerDaniil Baturin <daniil.baturin@vyatta.com>2011-07-26 19:47:57 +0700
commit40417afbaf508ec18dbee5e033ec11a280969d7c (patch)
tree99f0b17af7a8ceecd0fbf454cf8d137956fe4c71 /templates-cfg
parent47abe6c3ed91fc223ffee68d14736599203aac44 (diff)
downloadvyatta-nat-40417afbaf508ec18dbee5e033ec11a280969d7c.tar.gz
vyatta-nat-40417afbaf508ec18dbee5e033ec11a280969d7c.zip
Modify NAT configuration templates to support "any" inbound-interface and outbound-interface.
Diffstat (limited to 'templates-cfg')
-rw-r--r--templates-cfg/nat/rule/node.tag/inbound-interface/node.def7
-rw-r--r--templates-cfg/nat/rule/node.tag/outbound-interface/node.def7
2 files changed, 10 insertions, 4 deletions
diff --git a/templates-cfg/nat/rule/node.tag/inbound-interface/node.def b/templates-cfg/nat/rule/node.tag/inbound-interface/node.def
index 69913d6..43c2998 100644
--- a/templates-cfg/nat/rule/node.tag/inbound-interface/node.def
+++ b/templates-cfg/nat/rule/node.tag/inbound-interface/node.def
@@ -2,11 +2,14 @@ type: txt
help: Inbound interface of NAT traffic
-enumeration: existing-interfaces
+enumeration: existing-interfaces; echo "any"
-val_help: <interface> ; Interface name
+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
diff --git a/templates-cfg/nat/rule/node.tag/outbound-interface/node.def b/templates-cfg/nat/rule/node.tag/outbound-interface/node.def
index 28e42e8..fa432cf 100644
--- a/templates-cfg/nat/rule/node.tag/outbound-interface/node.def
+++ b/templates-cfg/nat/rule/node.tag/outbound-interface/node.def
@@ -2,11 +2,14 @@ type: txt
help: Outbound interface for NAT traffic
-enumeration: existing-interfaces
+enumeration: existing-interfaces; echo "any"
-val_help: <interface> ; Interface name
+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