diff options
author | Daniil Baturin <daniil@baturin.org> | 2014-04-06 02:46:03 -0700 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2014-04-06 02:46:03 -0700 |
commit | e9f1054117b3134e44adecba97e658d841ecf42b (patch) | |
tree | 37ace30e07f11d2c7acc24c27c9818daa4d3f491 /templates/interfaces/dummy | |
parent | 779eed7810b0752b4670e1fc666e92c026e67cf4 (diff) | |
download | vyatta-cfg-system-e9f1054117b3134e44adecba97e658d841ecf42b.tar.gz vyatta-cfg-system-e9f1054117b3134e44adecba97e658d841ecf42b.zip |
Bug #159: add conf mode templates for dummy interfaces.
Diffstat (limited to 'templates/interfaces/dummy')
-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 |