summaryrefslogtreecommitdiff
path: root/templates/interfaces/loopback
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-21 10:52:40 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-12-21 10:52:40 -0800
commitd234dbf62a065de2b799f9b57c1b476c07a6bc17 (patch)
tree276dcc9e0854cb549e1f42ae29b6ee518c823e48 /templates/interfaces/loopback
parent7f58b680525bcf9a07f9f1e4c1a6fc4aa7815dae (diff)
downloadvyatta-cfg-system-d234dbf62a065de2b799f9b57c1b476c07a6bc17.tar.gz
vyatta-cfg-system-d234dbf62a065de2b799f9b57c1b476c07a6bc17.zip
Move interface support from vyatta-cfg to vyatta-cfg-system
All the other interface types are in vyatta-cfg-system, only loopback and ethernet were in vyatta-cfg
Diffstat (limited to 'templates/interfaces/loopback')
-rw-r--r--templates/interfaces/loopback/node.def8
-rw-r--r--templates/interfaces/loopback/node.tag/address/node.def18
-rw-r--r--templates/interfaces/loopback/node.tag/description/node.def4
3 files changed, 30 insertions, 0 deletions
diff --git a/templates/interfaces/loopback/node.def b/templates/interfaces/loopback/node.def
new file mode 100644
index 00000000..64485e54
--- /dev/null
+++ b/templates/interfaces/loopback/node.def
@@ -0,0 +1,8 @@
+tag:
+priority: 320
+type: txt
+help: Set loopback interface
+syntax:expression: exec \
+ "/opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(@) --check=loopback"
+allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=loopback
+create: sudo ip link set $VAR(@) up
diff --git a/templates/interfaces/loopback/node.tag/address/node.def b/templates/interfaces/loopback/node.tag/address/node.def
new file mode 100644
index 00000000..76c2e76e
--- /dev/null
+++ b/templates/interfaces/loopback/node.tag/address/node.def
@@ -0,0 +1,18 @@
+multi:
+
+type: txt
+
+help: Set an IP address for this interface
+
+syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr-set $VAR(@) --dev $VAR(../@)"; \
+ "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../@)"
+
+create:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@)"; \
+ "Error setting address $VAR(@) on interface $VAR(../@)"
+
+delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@)"; \
+ "Error deleting address $VAR(@) on interface $VAR(../@)"
+
+comp_help:Possible completions:
+ <x.x.x.x/x> Set the IP address and prefix length
+ <h:h:h:h:h:h:h:h/x> Set the IPv6 address and prefix length
diff --git a/templates/interfaces/loopback/node.tag/description/node.def b/templates/interfaces/loopback/node.tag/description/node.def
new file mode 100644
index 00000000..7f64c788
--- /dev/null
+++ b/templates/interfaces/loopback/node.tag/description/node.def
@@ -0,0 +1,4 @@
+type: txt
+help: Set description for this interface
+update: sudo sh -c "echo \"$VAR(@)\" >/sys/class/net/$VAR(../@)/ifalias"
+delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../@)/ifalias"