diff options
Diffstat (limited to 'templates/policy/route/node.def')
-rw-r--r-- | templates/policy/route/node.def | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/templates/policy/route/node.def b/templates/policy/route/node.def new file mode 100644 index 0000000..edfd75b --- /dev/null +++ b/templates/policy/route/node.def @@ -0,0 +1,31 @@ +tag: +priority: 471 + +type: txt + +syntax:expression: pattern $VAR(@) "^[[:print:]]{1,28}$" ; \ + "Policy route rule set name must be 28 characters or less" +syntax:expression: pattern $VAR(@) "^[^-]" ; \ + "Policy route rule set name cannot start with \"-\"" +syntax:expression: pattern $VAR(@) "^[^;]*$" ; \ + "Policy route rule set name cannot contain ';'" +syntax:expression: ! pattern $VAR(@) "^VZONE" ; \ + "Policy route rule set name cannot start with 'VZONE'" + +end: if sudo /opt/vyatta/sbin/vyatta-firewall.pl --update-rules "policy route" "$VAR(@)" ; + then + if [ ${COMMIT_ACTION} = 'DELETE' ] ; + then + if sudo /opt/vyatta/sbin/vyatta-firewall.pl --teardown-ok "policy route" ; + then + sudo /opt/vyatta/sbin/vyatta-firewall.pl --teardown "policy route" + fi + fi + else + exit 1; + fi + sudo /opt/vyatta/sbin/vyatta-ipset.pl --action=prune-deleted-sets + +create: sudo /opt/vyatta/sbin/vyatta-firewall.pl --setup iptables "policy route" + +help: Policy route rule set name |