diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/interfaces/dummy/node.def | 13 | ||||
-rw-r--r-- | templates/interfaces/dummy/node.tag/address/node.def | 12 | ||||
-rw-r--r-- | templates/interfaces/dummy/node.tag/description/node.def | 8 | ||||
-rw-r--r-- | templates/interfaces/dummy/node.tag/disable/node.def | 4 |
4 files changed, 37 insertions, 0 deletions
diff --git a/templates/interfaces/dummy/node.def b/templates/interfaces/dummy/node.def new file mode 100644 index 00000000..e3ef83de --- /dev/null +++ b/templates/interfaces/dummy/node.def @@ -0,0 +1,13 @@ +tag: +priority: 300 +type: txt +help: Dummy interface name +syntax:expression: pattern $VAR(@) "^dummy[0-9]+$" \ + ; "name must be (dummy0-dummy999)" +val_help: <dummyN>; Dummy interface name + +begin: [ -d /sys/module/dummy ] || sudo modprobe dummy + +create: ip link add name $VAR(@) type dummy + ip link set $VAR(@) up + diff --git a/templates/interfaces/dummy/node.tag/address/node.def b/templates/interfaces/dummy/node.tag/address/node.def new file mode 100644 index 00000000..04612379 --- /dev/null +++ b/templates/interfaces/dummy/node.tag/address/node.def @@ -0,0 +1,12 @@ +multi: +type: ipv4net,ipv6net +val_help: ipv4net; IPv4 address and prefix length +val_help: ipv6net; IPv6 address and prefix length +help: IP address + +syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" + +create: sudo /opt/vyatta/sbin/vyatta-address add $VAR(../@) $VAR(@) + +delete: sudo /opt/vyatta/sbin/vyatta-address delete $VAR(../@) $VAR(@) + diff --git a/templates/interfaces/dummy/node.tag/description/node.def b/templates/interfaces/dummy/node.tag/description/node.def new file mode 100644 index 00000000..c6d2789d --- /dev/null +++ b/templates/interfaces/dummy/node.tag/description/node.def @@ -0,0 +1,8 @@ +type: txt +help: Description + +syntax:expression: pattern $VAR(@) "^.{1,256}$" \ + ; "interface description is too long (limit 256 characters)" + +update: sudo sh -c "echo \"$VAR(@)\" >/sys/class/net/$VAR(../@)/ifalias" +delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias" diff --git a/templates/interfaces/dummy/node.tag/disable/node.def b/templates/interfaces/dummy/node.tag/disable/node.def new file mode 100644 index 00000000..26199646 --- /dev/null +++ b/templates/interfaces/dummy/node.tag/disable/node.def @@ -0,0 +1,4 @@ +help: Disable interface +update: ip link set $VAR(../@) down + +delete: ip link set $VAR(../@) up |