summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-06-21 11:09:51 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-06-21 11:09:51 -0700
commitd801c05f63b0b16f485b176db64e3147ad7d3086 (patch)
tree9829f0bf340a55986aa6d11f1b1d8d5334306abd /templates
parent6d59b5077ef1834379a950437b01d15d687c7a53 (diff)
parent7369bf61abd3eed1fdd17a56908cf2c0ffc9843f (diff)
downloadvyatta-cfg-system-d801c05f63b0b16f485b176db64e3147ad7d3086.tar.gz
vyatta-cfg-system-d801c05f63b0b16f485b176db64e3147ad7d3086.zip
Merge branch 'larkspur' of http://git.vyatta.com/vyatta-cfg-system into larkspur
Diffstat (limited to 'templates')
-rw-r--r--templates/interfaces/bonding/node.def6
-rw-r--r--templates/interfaces/bonding/node.tag/bridge-group/node.def16
-rw-r--r--templates/interfaces/bonding/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/bonding/node.tag/mtu/node.def4
-rw-r--r--templates/interfaces/bonding/node.tag/vif/node.def6
-rw-r--r--templates/interfaces/bonding/node.tag/vif/node.tag/bridge-group/node.def16
-rw-r--r--templates/interfaces/bonding/node.tag/vif/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/bridge/node.def12
-rw-r--r--templates/interfaces/bridge/node.tag/aging/node.def4
-rw-r--r--templates/interfaces/bridge/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/bridge/node.tag/forwarding-delay/node.def2
-rw-r--r--templates/interfaces/bridge/node.tag/hello-time/node.def4
-rw-r--r--templates/interfaces/bridge/node.tag/max-age/node.def4
-rw-r--r--templates/interfaces/bridge/node.tag/priority/node.def4
-rw-r--r--templates/interfaces/bridge/node.tag/stp/node.def12
-rw-r--r--templates/interfaces/ethernet/node.def8
-rw-r--r--templates/interfaces/ethernet/node.tag/address/node.def43
-rw-r--r--templates/interfaces/ethernet/node.tag/bridge-group/node.def16
-rw-r--r--templates/interfaces/ethernet/node.tag/dhcpv6-options/node.def49
-rw-r--r--templates/interfaces/ethernet/node.tag/dhcpv6-options/parameters-only/node.def3
-rw-r--r--templates/interfaces/ethernet/node.tag/dhcpv6-options/temporary/node.def3
-rw-r--r--templates/interfaces/ethernet/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/ethernet/node.tag/mtu/node.def4
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.def6
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def16
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/ip/enable-proxy-arp/node.def3
-rw-r--r--templates/interfaces/input/node.def7
-rw-r--r--templates/interfaces/loopback/node.def5
-rw-r--r--templates/interfaces/pseudo-ethernet/node.def10
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/tunnel/node.def41
-rw-r--r--templates/interfaces/tunnel/node.tag/bridge-group/bridge/node.def16
-rw-r--r--templates/interfaces/tunnel/node.tag/bridge-group/cost/node.def9
-rw-r--r--templates/interfaces/tunnel/node.tag/bridge-group/node.def1
-rw-r--r--templates/interfaces/tunnel/node.tag/bridge-group/priority/node.def8
-rw-r--r--templates/interfaces/tunnel/node.tag/disable/node.def6
-rw-r--r--templates/interfaces/tunnel/node.tag/encapsulation/node.def6
-rw-r--r--templates/interfaces/tunnel/node.tag/key/node.def2
-rw-r--r--templates/interfaces/tunnel/node.tag/mtu/node.def4
-rw-r--r--templates/interfaces/tunnel/node.tag/tos/node.def4
-rw-r--r--templates/interfaces/tunnel/node.tag/ttl/node.def8
-rw-r--r--templates/service/snmp/community/node.tag/client/node.def2
-rw-r--r--templates/service/snmp/community/node.tag/network/node.def2
-rw-r--r--templates/service/snmp/listen-address/node.def3
-rw-r--r--templates/service/snmp/listen-address/node.tag/port/node.def3
-rw-r--r--templates/service/snmp/node.def3
-rw-r--r--templates/service/snmp/trap-source/node.def2
-rw-r--r--templates/service/snmp/trap-target/node.def4
-rw-r--r--templates/system/domain-name/node.def4
50 files changed, 277 insertions, 138 deletions
diff --git a/templates/interfaces/bonding/node.def b/templates/interfaces/bonding/node.def
index bb1b9ae3..4a944970 100644
--- a/templates/interfaces/bonding/node.def
+++ b/templates/interfaces/bonding/node.def
@@ -1,14 +1,15 @@
tag:
priority: 315
type: txt
-help: Set bonding interface
+help: Set bonding interface name
+comp_help: Enter bonding interface name (bond0 - bond99)
syntax:expression: pattern $VAR(@) "^bond[0-9]+$" \
; "bonding must be (bond0-bond99)"
begin: if [ ! -f /sys/class/net/bonding_masters ]; then
sudo modprobe bonding max_bonds=0 miimon=250
fi
create: sudo sh -c "echo +$VAR(@) > /sys/class/net/bonding_masters" || exit 1
- sudo ip link set "$VAR(@)" up
+ ip link set "$VAR(@)" up
/opt/vyatta/sbin/vyatta-link-detect $VAR(@) on
delete: SLAVES=`cat /sys/class/net/$VAR(@)/bonding/slaves`;
if [ -z "$SLAVES" ]
@@ -18,4 +19,3 @@ delete: SLAVES=`cat /sys/class/net/$VAR(@)/bonding/slaves`;
echo "bonded interface $VAR(@) still has slaves: $SLAVES"
exit 1;
fi
-comp_help: Enter bond interface name (bond0 - bond99)
diff --git a/templates/interfaces/bonding/node.tag/bridge-group/node.def b/templates/interfaces/bonding/node.tag/bridge-group/node.def
index 940295fa..9ce97b1b 100644
--- a/templates/interfaces/bonding/node.tag/bridge-group/node.def
+++ b/templates/interfaces/bonding/node.tag/bridge-group/node.def
@@ -12,13 +12,13 @@ end:
exit 1
else
echo "Adding interface $bondif to bridge $newbridge."
- sudo brctl addif $newbridge $bondif;
+ /usr/sbin/brctl addif $newbridge $bondif;
if [ -n "$VAR(./cost/@)" ]; then
- sudo brctl setpathcost $newbridge $bondif $VAR(./cost/@);
+ /usr/sbin/brctl setpathcost $newbridge $bondif $VAR(./cost/@);
fi;
if [ -n "$VAR(./priority/@)" ]; then
- sudo brctl setportprio $newbridge $bondif $VAR(./priority/@);
+ /usr/sbin/brctl setportprio $newbridge $bondif $VAR(./priority/@);
fi
fi
elif [ ${COMMIT_ACTION} = 'DELETE' ]; then
@@ -32,7 +32,7 @@ end:
# it gets deleted before the removal of bridge-groups under interfaces
exit 0
else
- sudo brctl delif $oldbridge $bondif
+ /usr/sbin/brctl delif $oldbridge $bondif
fi
else
if [ -z "$newbridge" ]; then
@@ -46,15 +46,15 @@ end:
if ! /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \
--bridge-notin-proposedcfg \
--bridge-interface="$oldbridge"; then \
- sudo brctl delif $oldbridge $bondif
+ /usr/sbin/brctl delif $oldbridge $bondif
fi
- sudo brctl addif $newbridge $bondif
+ /usr/sbin/brctl addif $newbridge $bondif
fi
if [ -n "$VAR(./cost/@)" ]; then
- sudo brctl setpathcost $newbridge $bondif $VAR(./cost/@)
+ /usr/sbin/brctl setpathcost $newbridge $bondif $VAR(./cost/@)
fi
if [ -n "$VAR(./priority/@)" ]; then
- sudo brctl setportprio $newbridge $bondif $VAR(./priority/@)
+ /usr/sbin/brctl setportprio $newbridge $bondif $VAR(./priority/@)
fi
fi
fi
diff --git a/templates/interfaces/bonding/node.tag/disable/node.def b/templates/interfaces/bonding/node.tag/disable/node.def
index ad033365..96325d72 100644
--- a/templates/interfaces/bonding/node.tag/disable/node.def
+++ b/templates/interfaces/bonding/node.tag/disable/node.def
@@ -1,11 +1,11 @@
help: Set interface disabled
create: /etc/netplug/linkdown.d/dhclient $VAR(../@)
- if ! sudo ip link set $VAR(../@) down 2>/dev/null; then
+ if ! ip link set $VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../@)
exit 1
fi
-delete: if ! sudo ip link set $VAR(../@) up; then
+delete: if ! ip link set $VAR(../@) up; then
echo "Error enabling dev $VAR(../@)"
exit 1
fi
diff --git a/templates/interfaces/bonding/node.tag/mtu/node.def b/templates/interfaces/bonding/node.tag/mtu/node.def
index 07c102ac..cd244402 100644
--- a/templates/interfaces/bonding/node.tag/mtu/node.def
+++ b/templates/interfaces/bonding/node.tag/mtu/node.def
@@ -1,5 +1,5 @@
type: u32
help: Set the Maximum Transmission Unit (MTU) for this interface
syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000"
-update:expression: "sudo ip link set $VAR(../@) mtu $VAR(@)"; "Error setting MTU on dev $VAR(../@)"
-delete:expression: "sudo ip link set $VAR(../@) mtu 1500"; "Error deleting MTU on dev $VAR(../@)"
+update: ip link set $VAR(../@) mtu $VAR(@)
+delete: ip link set $VAR(../@) mtu 1500
diff --git a/templates/interfaces/bonding/node.tag/vif/node.def b/templates/interfaces/bonding/node.tag/vif/node.def
index 2e718f41..62e7ab95 100644
--- a/templates/interfaces/bonding/node.tag/vif/node.def
+++ b/templates/interfaces/bonding/node.tag/vif/node.def
@@ -8,9 +8,9 @@ create: read -a SLAVES </sys/class/net/$VAR(../@)/bonding/slaves
echo "Must configure slave devices for bond interface $VAR(../@) before adding vif"
exit 1
fi
- sudo ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1
- sudo ip link set "$VAR(../@).$VAR(@)" up
+ ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1
+ ip link set "$VAR(../@).$VAR(@)" up
sudo sh -c "/opt/vyatta/sbin/vyatta-link-detect $VAR(../@).$VAR(@) on"
-delete: sudo ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
+delete: ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
comp_help: possible completions:
<0-4094> Set VLAN ID
diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/bridge-group/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/bridge-group/node.def
index 04dc957b..42234106 100644
--- a/templates/interfaces/bonding/node.tag/vif/node.tag/bridge-group/node.def
+++ b/templates/interfaces/bonding/node.tag/vif/node.tag/bridge-group/node.def
@@ -13,13 +13,13 @@ end:
exit 1
else
echo "Adding interface $bondif to bridge $newbridge."
- sudo brctl addif $newbridge $bondif;
+ /usr/sbin/brctl addif $newbridge $bondif;
if [ -n "$VAR(./cost/@)" ]; then
- sudo brctl setpathcost $newbridge $bondif $VAR(./cost/@);
+ /usr/sbin/brctl setpathcost $newbridge $bondif $VAR(./cost/@);
fi;
if [ -n "$VAR(./priority/@)" ]; then
- sudo brctl setportprio $newbridge $bondif $VAR(./priority/@);
+ /usr/sbin/brctl setportprio $newbridge $bondif $VAR(./priority/@);
fi
fi
elif [ ${COMMIT_ACTION} = 'DELETE' ]; then
@@ -33,7 +33,7 @@ end:
# it gets deleted before the removal of bridge-groups under interfaces
exit 0
else
- sudo brctl delif $oldbridge $bondif
+ /usr/sbin/brctl delif $oldbridge $bondif
fi
else
if [ -z "$newbridge" ]; then
@@ -47,15 +47,15 @@ end:
if ! /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \
--bridge-notin-proposedcfg \
--bridge-interface="$oldbridge"; then \
- sudo brctl delif $oldbridge $bondif
+ /usr/sbin/brctl delif $oldbridge $bondif
fi
- sudo brctl addif $newbridge $bondif
+ /usr/sbin/brctl addif $newbridge $bondif
fi
if [ -n "$VAR(./cost/@)" ]; then
- sudo brctl setpathcost $newbridge $bondif $VAR(./cost/@)
+ /usr/sbin/brctl setpathcost $newbridge $bondif $VAR(./cost/@)
fi
if [ -n "$VAR(./priority/@)" ]; then
- sudo brctl setportprio $newbridge $bondif $VAR(./priority/@)
+ /usr/sbin/brctl setportprio $newbridge $bondif $VAR(./priority/@)
fi
fi
fi
diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/disable/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/disable/node.def
index 78b24870..b2119c9c 100644
--- a/templates/interfaces/bonding/node.tag/vif/node.tag/disable/node.def
+++ b/templates/interfaces/bonding/node.tag/vif/node.tag/disable/node.def
@@ -1,11 +1,11 @@
help: Set interface disabled
update: /etc/netplug/linkdown.d/dhclient $VAR(../../@).$VAR(../@)
- if ! sudo ip link set $VAR(../../@).$VAR(../@) down 2>/dev/null; then
+ if ! ip link set $VAR(../../@).$VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../../@).$VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../../@).$VAR(../@)
exit 1
fi
-delete: if ! sudo ip link set $VAR(../../@).$VAR(../@) up; then
+delete: if ! ip link set $VAR(../../@).$VAR(../@) up; then
echo "Error enabling dev $VAR(../../@).$VAR(../@)"
exit 1
fi
diff --git a/templates/interfaces/bridge/node.def b/templates/interfaces/bridge/node.def
index 55c961ba..60af4bc0 100644
--- a/templates/interfaces/bridge/node.def
+++ b/templates/interfaces/bridge/node.def
@@ -1,19 +1,19 @@
tag:
priority: 310
type: txt
-help: Set bridge interface
+help: Set bridge interface name
+comp_help: "Enter bridge interface name (br0 - br999)"
syntax:expression: pattern $VAR(@) "^br[0-9]+$" ; "Must be (br0 - br999)"
-create: sudo brctl addbr $VAR(@)
- sudo ip link set $VAR(@) up
+create: /usr/sbin/brctl addbr $VAR(@)
+ ip link set $VAR(@) up
delete: if ! /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \
--no-interfaces-assigned \
--bridge-interface="$VAR(@)"; then \
exit 1
fi
- sudo ip link set $VAR(@) down;
- sudo brctl delbr $VAR(@);
+ ip link set $VAR(@) down;
+ /usr/sbin/brctl delbr $VAR(@);
-comp_help: "Enter bridge interface name (br0 - br999)"
diff --git a/templates/interfaces/bridge/node.tag/aging/node.def b/templates/interfaces/bridge/node.tag/aging/node.def
index 533a8ed5..cd2e5d1a 100644
--- a/templates/interfaces/bridge/node.tag/aging/node.def
+++ b/templates/interfaces/bridge/node.tag/aging/node.def
@@ -1,7 +1,7 @@
type: u32
help: Set the number of seconds a MAC address will be kept in the forwarding database
default: 300
-update:expression: "sudo brctl setageing $VAR(../@) $VAR(@)"
-delete:expression: "sudo brctl setageing $VAR(../@) 300"
+update: /usr/sbin/brctl setageing $VAR(../@) $VAR(@)
+delete: /usr/sbin/brctl setageing $VAR(../@) 300
comp_help: possible completions:
<number> Set the number of seconds for ageing (default 300)
diff --git a/templates/interfaces/bridge/node.tag/disable/node.def b/templates/interfaces/bridge/node.tag/disable/node.def
index 3f37a6d6..2e20be3b 100644
--- a/templates/interfaces/bridge/node.tag/disable/node.def
+++ b/templates/interfaces/bridge/node.tag/disable/node.def
@@ -1,11 +1,11 @@
help: Disable the bridge interface
update: /etc/netplug/linkdown.d/dhclient $VAR(../@)
- if ! sudo ip link set $VAR(../@) down 2>/dev/null; then
+ if ! ip link set $VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../@)
exit 1
fi
-delete: if ! sudo ip link set $VAR(../@) up; then
+delete: if ! ip link set $VAR(../@) up; then
echo "Error enabling dev $VAR(../@)"
exit 1
fi
diff --git a/templates/interfaces/bridge/node.tag/forwarding-delay/node.def b/templates/interfaces/bridge/node.tag/forwarding-delay/node.def
index 458eb320..c273c648 100644
--- a/templates/interfaces/bridge/node.tag/forwarding-delay/node.def
+++ b/templates/interfaces/bridge/node.tag/forwarding-delay/node.def
@@ -1,5 +1,5 @@
type: u32
help: Set the forwarding delay
-update: sudo brctl setfd $VAR(../@) $VAR(@)
+update: /usr/sbin/brctl setfd $VAR(../@) $VAR(@)
comp_help: possible completions:
<number> Set the folwarding delay (default 15)
diff --git a/templates/interfaces/bridge/node.tag/hello-time/node.def b/templates/interfaces/bridge/node.tag/hello-time/node.def
index 19324a65..8c6ad277 100644
--- a/templates/interfaces/bridge/node.tag/hello-time/node.def
+++ b/templates/interfaces/bridge/node.tag/hello-time/node.def
@@ -1,8 +1,8 @@
type: u32
help: Set the hello packet advertisment interval
default: 2
-update:expression: "sudo brctl sethello $VAR(../@) $VAR(@)"
-delete:expression: "sudo brctl sethello $VAR(../@) 2"
+update: /usr/sbin/brctl sethello $VAR(../@) $VAR(@)
+delete: /usr/sbin/brctl sethello $VAR(../@) 2
comp_help: possible completions:
<number> Set the hello packet advertisment interval (default 2)
diff --git a/templates/interfaces/bridge/node.tag/max-age/node.def b/templates/interfaces/bridge/node.tag/max-age/node.def
index ddfdf129..43a9ad04 100644
--- a/templates/interfaces/bridge/node.tag/max-age/node.def
+++ b/templates/interfaces/bridge/node.tag/max-age/node.def
@@ -1,8 +1,8 @@
type: u32
help: Set the interval at which neighbor bridges are removed
default: 20
-update:expression: "sudo brctl setmaxage $VAR(../@) $VAR(@)"
-delete:expression: "sudo brctl setmaxage $VAR(../@) 20"
+update: /usr/sbin/brctl setmaxage $VAR(../@) $VAR(@)
+delete: /usr/sbin/brctl setmaxage $VAR(../@) 20
comp_help: possible completions:
<number> Set the max age (default 20)
diff --git a/templates/interfaces/bridge/node.tag/priority/node.def b/templates/interfaces/bridge/node.tag/priority/node.def
index 1084dbf3..63548d1e 100644
--- a/templates/interfaces/bridge/node.tag/priority/node.def
+++ b/templates/interfaces/bridge/node.tag/priority/node.def
@@ -1,7 +1,7 @@
type: u32
help: Set the priority for this bridge
default: 0
-update:expression: "sudo brctl setbridgeprio $VAR(../@) $VAR(@)"
-delete:expression: "sudo brctl setbridgeprio $VAR(../@) 0"
+update: /usr/sbin/brctl setbridgeprio $VAR(../@) $VAR(@)
+delete: /usr/sbin/brctl setbridgeprio $VAR(../@) 0
comp_help: possible completions:
<number> Set bridge priority (default 0)
diff --git a/templates/interfaces/bridge/node.tag/stp/node.def b/templates/interfaces/bridge/node.tag/stp/node.def
index 6f25f0cc..f3095b26 100644
--- a/templates/interfaces/bridge/node.tag/stp/node.def
+++ b/templates/interfaces/bridge/node.tag/stp/node.def
@@ -3,16 +3,16 @@ help: Enable spanning tree protocol
default: false
update: if [ "$VAR(@)" == "true" ]; then
if [ -z "$VAR(../../forwarding-delay)" ]; then
- sudo brctl setfd $VAR(../@) 15
+ /usr/sbin/brctl setfd $VAR(../@) 15
else
- sudo brctl setfd $VAR(../@) $VAR(../../forwarding-delay)
+ /usr/sbin/brctl setfd $VAR(../@) $VAR(../../forwarding-delay)
fi
- sudo brctl stp $VAR(../@) on
+ /usr/sbin/brctl stp $VAR(../@) on
else
- sudo brctl stp $VAR(../@) off
- sudo brctl setfd $VAR(../@) 0
+ /usr/sbin/brctl stp $VAR(../@) off
+ /usr/sbin/brctl setfd $VAR(../@) 0
fi
-delete:sudo brctl stp $VAR(../@) off
+delete:/usr/sbin/brctl stp $VAR(../@) off
comp_help: possible completions:
true Enable Spanning Tree Protocol
false Disable Spanning Tree Protocol (default false)
diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def
index 081cabb5..05b2e03c 100644
--- a/templates/interfaces/ethernet/node.def
+++ b/templates/interfaces/ethernet/node.def
@@ -1,7 +1,9 @@
tag:
priority: 318
type: txt
-help: Set ethernet interface
+help: Set Ethernet interface name
+comp_help: Enter Ethernet interface name (eth0 - eth999)
+
allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=ethernet
syntax:expression: pattern $VAR(@) "^eth[0-9]+$" \
; "interface ethernet $VAR(@): not a valid name"
@@ -10,7 +12,7 @@ syntax:expression: exec \
echo \"interface ethernet $VAR(@): does not exist\";
exit 1; \
fi"
-create: sudo ip link set "$VAR(@)" up
+create: ip link set "$VAR(@)" up
/opt/vyatta/sbin/vyatta-link-detect $VAR(@) on
delete: [ -d /sys/class/net/$VAR(../@) ] || exit 0
- sudo ip link set $VAR(@) down
+ ip link set $VAR(@) down
diff --git a/templates/interfaces/ethernet/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/address/node.def
index db87ff05..7ed12bba 100644
--- a/templates/interfaces/ethernet/node.tag/address/node.def
+++ b/templates/interfaces/ethernet/node.tag/address/node.def
@@ -15,14 +15,41 @@ syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr-set
#
commit:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr-commit $VAR(@@) --dev $VAR(../@)"
-create:sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@)
-
-delete:sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@)
-
-allowed: echo "dhcp <>"
+create:
+ ifname=$VAR(../@)
+ param=$VAR(@)
+ if [ "$param" = "dhcpv6" ]; then
+ if [ -n "$VAR(../dhcpv6-options/parameters-only)" ]; then
+ echo "parameters-only is set"
+ arg1="--parameters-only"
+ fi
+ if [ -n "$VAR(../dhcpv6-options/temporary)" ]; then
+ echo "temporary is set"
+ arg2="--temporary"
+ fi
+
+ echo "Starting DHCPv6 client on ${ifname}..."
+ sudo /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --start \
+ --ifname $ifname $arg1 $arg2
+ else
+ sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@)
+ fi
+
+delete:
+ ifname=$VAR(../@)
+ param=$VAR(@)
+ if [ "$param" = "dhcpv6" ]; then
+ echo "Stopping DHCPv6 client on ${ifname}..."
+ sudo /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --stop --ifname \
+ $ifname
+ else
+ sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@)
+ fi
+
+allowed: echo "dhcp dhcpv6 <>"
comp_help:Possible completions:
- <x.x.x.x/x> Set the IP address and prefix length
+ <x.x.x.x/x> Set the IPv4 address and prefix length
<h:h:h:h:h:h:h:h/x> Set the IPv6 address and prefix length
- dhcp Set the IP address and prefix length via DHCP
-
+ dhcp Set the IPv4 address and prefix length via DHCP
+ dhcpv6 Set the IPv6 address and prefix length via DHCPv6
diff --git a/templates/interfaces/ethernet/node.tag/bridge-group/node.def b/templates/interfaces/ethernet/node.tag/bridge-group/node.def
index 7590dc96..c56c31cc 100644
--- a/templates/interfaces/ethernet/node.tag/bridge-group/node.def
+++ b/templates/interfaces/ethernet/node.tag/bridge-group/node.def
@@ -11,13 +11,13 @@ end:
exit 1
else
echo "Adding interface $ethif to bridge $newbridge."
- sudo brctl addif $newbridge $ethif;
+ /usr/sbin/brctl addif $newbridge $ethif;
if [ -n "$VAR(./cost/@)" ]; then
- sudo brctl setpathcost $newbridge $ethif $VAR(./cost/@);
+ /usr/sbin/brctl setpathcost $newbridge $ethif $VAR(./cost/@);
fi;
if [ -n "$VAR(./priority/@)" ]; then
- sudo brctl setportprio $newbridge $ethif $VAR(./priority/@);
+ /usr/sbin/brctl setportprio $newbridge $ethif $VAR(./priority/@);
fi
fi
elif [ ${COMMIT_ACTION} = 'DELETE' ]; then
@@ -31,7 +31,7 @@ end:
# it gets deleted before the removal of bridge-groups under interfaces
exit 0
else
- sudo brctl delif $oldbridge $ethif
+ /usr/sbin/brctl delif $oldbridge $ethif
fi
else
if [ -z "$newbridge" ]; then
@@ -45,15 +45,15 @@ end:
if ! /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \
--bridge-notin-proposedcfg \
--bridge-interface="$oldbridge"; then \
- sudo brctl delif $oldbridge $ethif
+ /usr/sbin/brctl delif $oldbridge $ethif
fi
- sudo brctl addif $newbridge $ethif
+ /usr/sbin/brctl addif $newbridge $ethif
fi
if [ -n "$VAR(./cost/@)" ]; then
- sudo brctl setpathcost $newbridge $ethif $VAR(./cost/@)
+ /usr/sbin/brctl setpathcost $newbridge $ethif $VAR(./cost/@)
fi
if [ -n "$VAR(./priority/@)" ]; then
- sudo brctl setportprio $newbridge $ethif $VAR(./priority/@)
+ /usr/sbin/brctl setportprio $newbridge $ethif $VAR(./priority/@)
fi
fi
fi
diff --git a/templates/interfaces/ethernet/node.tag/dhcpv6-options/node.def b/templates/interfaces/ethernet/node.tag/dhcpv6-options/node.def
new file mode 100644
index 00000000..aaeca067
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/dhcpv6-options/node.def
@@ -0,0 +1,49 @@
+# This node is run before the rest of the interface is configured.
+# We first check to see if DHCPv6 is still configured on the interface by
+# looking over at the interface address parameters. Then we check to see
+# if the DHCPv6 client program is still running on this interface. If both
+# of those are true, then any change to this tree means that the user
+# has changed this tree ONLY, and that we are going to have to re-start
+# the DHCPv6 client using the new parameters.
+
+
+priority: 317 # Run before interface has been configured
+
+help: Set options for DHCPv6
+
+end:
+ ifname="$VAR(../@)"
+ echo "dhcpv6-options: ifname is $ifname"
+
+ dhcpv6_set=0
+ for param in $VAR(../address/@@); do
+ if [ "$param" = "dhcpv6" ]; then
+ dhcpv6_set=1
+ fi
+ done
+
+ if [ $dhcpv6_set -eq 0 ]; then
+ echo "DHCPv6 is not configured on this interface"
+ exit 0
+ fi
+
+ conffile=/var/lib/dhcp3/dhclient_v6_$VAR(../@).conf
+ if [ ! -e $conffile ]; then
+ echo "Conf file $conffile doesn't exist"
+ exit 0
+ fi
+
+ if [ -n "$VAR(./parameters-only)" ]; then
+ arg1="--parameters-only"
+ fi
+
+ if [ -n "$VAR(./temporary)" ]; then
+ arg2="--temporary"
+ fi
+
+ echo "Re-starting DHCPv6 client on ${ifname}..."
+ sudo /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --stop --start \
+ --ifname $ifname $arg1 $arg2
+
+ echo "Done."
+ exit 0 \ No newline at end of file
diff --git a/templates/interfaces/ethernet/node.tag/dhcpv6-options/parameters-only/node.def b/templates/interfaces/ethernet/node.tag/dhcpv6-options/parameters-only/node.def
new file mode 100644
index 00000000..0178c469
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/dhcpv6-options/parameters-only/node.def
@@ -0,0 +1,3 @@
+
+help: Acquire only config parameters, not address, via DHCPv6
+
diff --git a/templates/interfaces/ethernet/node.tag/dhcpv6-options/temporary/node.def b/templates/interfaces/ethernet/node.tag/dhcpv6-options/temporary/node.def
new file mode 100644
index 00000000..afb9de9c
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/dhcpv6-options/temporary/node.def
@@ -0,0 +1,3 @@
+
+help: Acquire a "temporary" IPv6 address
+
diff --git a/templates/interfaces/ethernet/node.tag/disable/node.def b/templates/interfaces/ethernet/node.tag/disable/node.def
index fbfb155a..5fe2b748 100644
--- a/templates/interfaces/ethernet/node.tag/disable/node.def
+++ b/templates/interfaces/ethernet/node.tag/disable/node.def
@@ -1,12 +1,12 @@
help: Set interface disabled
create: /etc/netplug/linkdown.d/dhclient $VAR(../@)
- if ! sudo ip link set $VAR(../@) down 2>/dev/null; then
+ if ! ip link set $VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../@)
exit 1
fi
delete: [ -d /sys/class/net/$VAR(../@) ] || exit 0
- if ! sudo ip link set $VAR(../@) up; then
+ if ! ip link set $VAR(../@) up; then
echo "Error enabling dev $VAR(../@)"
exit 1
fi
diff --git a/templates/interfaces/ethernet/node.tag/mtu/node.def b/templates/interfaces/ethernet/node.tag/mtu/node.def
index dc03ae16..f33158f8 100644
--- a/templates/interfaces/ethernet/node.tag/mtu/node.def
+++ b/templates/interfaces/ethernet/node.tag/mtu/node.def
@@ -1,8 +1,8 @@
type: u32
help: Set the Maximum Transmission Unit (MTU) for this interface
syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000"
-update: if ! sudo ip link set $VAR(../@) mtu $VAR(@)
+update: if ! ip link set $VAR(../@) mtu $VAR(@)
then echo "Error setting MTU on dev $VAR(../@)"; exit 1
fi
delete: [ -d /sys/class/net/$VAR(../@) ] || exit 0
- sudo ip link set $VAR(../@) mtu 1500
+ ip link set $VAR(../@) mtu 1500
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.def b/templates/interfaces/ethernet/node.tag/vif/node.def
index b6b8abc7..c14ed002 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.def
@@ -5,17 +5,17 @@ help: Set Virtual Local Area Network (VLAN) ID
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094"
-create: if ! sudo ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
+create: if ! ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
then echo "Error creating VLAN device $VAR(../@).$VAR(@)"
exit 1
fi
# if parent is up, then bring VLAN up
if [ $(( $(cat /sys/class/net/$VAR(../@)/flags) & 1 )) -eq 1 ]; then
- sudo ip link set "$VAR(../@).$VAR(@)" up
+ ip link set "$VAR(../@).$VAR(@)" up
fi
/opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on
delete: [ -d /sys/class/net/$VAR(../@) ] || exit 0
- sudo ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
+ ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
comp_help: possible completions:
<0-4094> Set VLAN ID
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def
index dd3863a0..84fa14f1 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/bridge-group/node.def
@@ -14,13 +14,13 @@ end:
exit 1
else
echo "Adding interface $ethif to bridge $newbridge."
- sudo brctl addif $newbridge $ethif;
+ /usr/sbin/brctl addif $newbridge $ethif;
if [ -n "$VAR(./cost/@)" ]; then
- sudo brctl setpathcost $newbridge $ethif $VAR(./cost/@);
+ /usr/sbin/brctl setpathcost $newbridge $ethif $VAR(./cost/@);
fi;
if [ -n "$VAR(./priority/@)" ]; then
- sudo brctl setportprio $newbridge $ethif $VAR(./priority/@);
+ /usr/sbin/brctl setportprio $newbridge $ethif $VAR(./priority/@);
fi
fi
elif [ ${COMMIT_ACTION} = 'DELETE' ]; then
@@ -34,7 +34,7 @@ end:
# it gets deleted before the removal of bridge-groups under interfaces
exit 0
else
- sudo brctl delif $oldbridge $ethif
+ /usr/sbin/brctl delif $oldbridge $ethif
fi
else
if [ -z "$newbridge" ]; then
@@ -48,15 +48,15 @@ end:
if ! /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \
--bridge-notin-proposedcfg \
--bridge-interface="$oldbridge"; then \
- sudo brctl delif $oldbridge $ethif
+ /usr/sbin/brctl delif $oldbridge $ethif
fi
- sudo brctl addif $newbridge $ethif
+ /usr/sbin/brctl addif $newbridge $ethif
fi
if [ -n "$VAR(./cost/@)" ]; then
- sudo brctl setpathcost $newbridge $ethif $VAR(./cost/@)
+ /usr/sbin/brctl setpathcost $newbridge $ethif $VAR(./cost/@)
fi
if [ -n "$VAR(./priority/@)" ]; then
- sudo brctl setportprio $newbridge $ethif $VAR(./priority/@)
+ /usr/sbin/brctl setportprio $newbridge $ethif $VAR(./priority/@)
fi
fi
fi
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def
index 78b24870..b2119c9c 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def
@@ -1,11 +1,11 @@
help: Set interface disabled
update: /etc/netplug/linkdown.d/dhclient $VAR(../../@).$VAR(../@)
- if ! sudo ip link set $VAR(../../@).$VAR(../@) down 2>/dev/null; then
+ if ! ip link set $VAR(../../@).$VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../../@).$VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../../@).$VAR(../@)
exit 1
fi
-delete: if ! sudo ip link set $VAR(../../@).$VAR(../@) up; then
+delete: if ! ip link set $VAR(../../@).$VAR(../@) up; then
echo "Error enabling dev $VAR(../../@).$VAR(../@)"
exit 1
fi
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/ip/enable-proxy-arp/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/ip/enable-proxy-arp/node.def
new file mode 100644
index 00000000..a45d4129
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/ip/enable-proxy-arp/node.def
@@ -0,0 +1,3 @@
+help: Set to enable proxy-arp on this interface
+create:expression: "sudo sh -c \"echo 1 > /proc/sys/net/ipv4/conf/$VAR(../../../@).$VAR(../../@)/proxy_arp\" "
+delete:expression: "sudo sh -c \"echo 0 > /proc/sys/net/ipv4/conf/$VAR(../../../@).$VAR(../../@)/proxy_arp\" "
diff --git a/templates/interfaces/input/node.def b/templates/interfaces/input/node.def
index 2695b8a6..1873190c 100644
--- a/templates/interfaces/input/node.def
+++ b/templates/interfaces/input/node.def
@@ -2,9 +2,10 @@ tag:
priority: 310 # before real devices that redirect
type: txt
help: Set input functional block (IFB) interface
+comp_help: Enter input functional block interface name (ifb0 - ifb999)
+
syntax:expression: pattern $VAR(@) "^ifb[0-9]+$" ; "name must be (ifb0-ifb999)"
begin: [ -d /sys/module/ifb ] || sudo modprobe ifb numifbs=0
-create: sudo ip link add $VAR(@) type ifb && sudo ip link set $VAR(@) up
-delete: sudo ip link delete dev $VAR(@)
-comp_help: Enter input functional block interface name (ifb0 - ifb999)
+create: ip link add $VAR(@) type ifb && ip link set $VAR(@) up
+delete: ip link delete dev $VAR(@)
diff --git a/templates/interfaces/loopback/node.def b/templates/interfaces/loopback/node.def
index 8312aafe..b78cf10b 100644
--- a/templates/interfaces/loopback/node.def
+++ b/templates/interfaces/loopback/node.def
@@ -1,8 +1,9 @@
tag:
priority: 300
type: txt
-help: Set loopback interface
+help: Set loopback interface name
+comp_help: Enter looback interface name (lo)
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
+create: ip link set $VAR(@) up
diff --git a/templates/interfaces/pseudo-ethernet/node.def b/templates/interfaces/pseudo-ethernet/node.def
index cdbff5c8..bf88b047 100644
--- a/templates/interfaces/pseudo-ethernet/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.def
@@ -1,13 +1,13 @@
tag:
priority: 390
type: txt
-help: Set Virtual Ethernet device
+help: Set Pseudo Ethernet device name
+comp_help: Enter Pseudo Ethernet interface name (peth0 - peth999)
syntax:expression: pattern $VAR(@) "^peth[0-9]+$" \
; "name must be (peth0-peth999)"
commit:expression: $VAR(link) != ""
; "link device must be set for virtual ethernet $VAR(@)"
-create: sudo ip link add $VAR(@) link $VAR(link/@) type macvlan || exit 1
- sudo ip link set $VAR(@) up
+create: ip link add $VAR(@) link $VAR(link/@) type macvlan || exit 1
+ ip link set $VAR(@) up
/opt/vyatta/sbin/vyatta-link-detect $VAR(@) on
-delete: sudo ip link delete dev $VAR(@) type macvlan
-comp_help: Enter virtual ethernet interface name (peth0 - peth999)
+delete: ip link delete dev $VAR(@) type macvlan
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/disable/node.def b/templates/interfaces/pseudo-ethernet/node.tag/disable/node.def
index 3d3ffef9..9dafeacf 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/disable/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/disable/node.def
@@ -5,12 +5,12 @@ create: vif=`/opt/vyatta/sbin/vyatta-interfaces.pl --vif=$VAR(../@) --show=all`
exit 1
fi
/etc/netplug/linkdown.d/dhclient $VAR(../@)
- if ! sudo ip link set $VAR(../@) down 2>/dev/null; then
+ if ! ip link set $VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../@)
exit 1
fi
-delete: if ! sudo ip link set $VAR(../@) up; then
+delete: if ! ip link set $VAR(../@) up; then
echo "Error enabling dev $VAR(../@)"
exit 1
fi
diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def
index ba3fa49a..a90c01f9 100644
--- a/templates/interfaces/tunnel/node.def
+++ b/templates/interfaces/tunnel/node.def
@@ -2,7 +2,7 @@ tag:
priority: 380
type: txt
help: Set tunnel interface
-
+comp_help: Enter tunnel interface name (tun0 - tun999)
syntax:expression: pattern $VAR(@) "^tun[0-9]+$" \
; "tunnel must be (tun0-tun999)"
@@ -13,19 +13,28 @@ commit:expression: $VAR(./remote-ip/) != "" ; \
commit:expression: $VAR(./encapsulation/) != "" ; \
"Must configure the tunnel encapsulation for $VAR(@)"
-create:expression: "\
- if [ -n \"$VAR(./key/@)\" ]; then \
- KEY=\"key $VAR(./key/@)\"; \
- fi; \
- if [ x$VAR(./multicast/@) == xenable ]; then \
- MC=\"multicast on allmulticast on\"; \
- fi; \
- sudo ip tunnel add $VAR(@) \
- local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) \
- mode $VAR(./encapsulation/@) $KEY; \
- sudo ip link set $VAR(@) $MC up;" ; \
- "Error creating $VAR(@)"
+create:if [ -n "$VAR(./key/@)" ]; then
+ KEY="key $VAR(./key/@)";
+ fi
+ if [ x$VAR(./multicast/@) == xenable ]; then
+ MC="multicast on allmulticast on";
+ fi
+ if [ -n "$VAR(./bridge-group/)" ] && [ "$VAR(./encapsulation/@)" != "gre-bridge" ]; then
+ echo "interfaces tunnel $VAR(@): Tunnel encapsulation type must be gre-bridge if a bridge group is defined";
+ exit 1;
+ fi
+ if [ "$VAR(./encapsulation/@)" == "gre-bridge" ]; then
+ ip link add $VAR(@) type gretap local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) ||
+ echo "interfaces tunnel $VAR(@): error creating tunnel interface"
+ else
+ ip tunnel add $VAR(@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) mode $VAR(./encapsulation/@) $KEY ||
+ echo "interfaces tunnel $VAR(@): error creating tunnel interface"
+ fi
+ ip link set $VAR(@) $MC up ||
+ echo "interfaces tunnel $VAR(@): error setting tunnel interface active"
-delete:expression: "sudo ip tunnel del $VAR(@)" ; "Error deleting $VAR(@)"
-
-comp_help: Enter tunnel interface name (tun0 - tun999)
+delete:if [ "$VAR(./encapsulation/@)" == "gre-bridge" ]; then
+ ip link delete $VAR(@)
+ else
+ ip tunnel del $VAR(@)
+ fi
diff --git a/templates/interfaces/tunnel/node.tag/bridge-group/bridge/node.def b/templates/interfaces/tunnel/node.tag/bridge-group/bridge/node.def
new file mode 100644
index 00000000..9c28ed63
--- /dev/null
+++ b/templates/interfaces/tunnel/node.tag/bridge-group/bridge/node.def
@@ -0,0 +1,16 @@
+type: txt
+help: Set this interface to a bridge-group
+allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=bridge
+commit:expression: exec \
+ "/opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(@) --check=bridge"
+commit:expression: $VAR(../../encapsulation/@) == "gre-bridge"; "tunnel encapsulation type must be gre-bridge"
+create:
+ # TODO: need to add logic for update as we need to remove the interface first.
+ if [ "$(ip link show $VAR(../../@) | grep ether)" ]; then
+ sudo brctl addif $VAR(@) $VAR(../../@) ||
+ echo interfaces tunnel $VAR(../../@) bridge-group bridge $VAR(@): error adding interface to bridge
+ else
+ echo interfaces tunnel $VAR(../../@) bridge-group bridge $VAR(@): tunnel encapsulation type must be gre-bridge
+ exit 1
+ fi
+delete: sudo brctl delif $VAR(@) $VAR(../../@)
diff --git a/templates/interfaces/tunnel/node.tag/bridge-group/cost/node.def b/templates/interfaces/tunnel/node.tag/bridge-group/cost/node.def
new file mode 100644
index 00000000..ed3bee26
--- /dev/null
+++ b/templates/interfaces/tunnel/node.tag/bridge-group/cost/node.def
@@ -0,0 +1,9 @@
+type: u32
+help: Set the path cost for this port
+comp_help: possible completions:
+ <0-2147483647> Set port cost
+commit:expression: $VAR(../bridge/@) != ""; "interface must first be assigned to a bridge"
+create: sudo brctl setpathcost $VAR(../bridge/@) $VAR(../../@) $VAR(@) ||
+ echo interfaces tunnel $VAR(../../@) bridge-group cost: error setting bridge cost
+delete: if [ -n "$( sudo brctl show | egrep $VAR(../../@) )" ]; then sudo brctl setpathcost $VAR(../bridge/@) $VAR(../../@) 0; fi;
+
diff --git a/templates/interfaces/tunnel/node.tag/bridge-group/node.def b/templates/interfaces/tunnel/node.tag/bridge-group/node.def
new file mode 100644
index 00000000..663979dd
--- /dev/null
+++ b/templates/interfaces/tunnel/node.tag/bridge-group/node.def
@@ -0,0 +1 @@
+help: Add this interface to a bridge group
diff --git a/templates/interfaces/tunnel/node.tag/bridge-group/priority/node.def b/templates/interfaces/tunnel/node.tag/bridge-group/priority/node.def
new file mode 100644
index 00000000..fe174f1f
--- /dev/null
+++ b/templates/interfaces/tunnel/node.tag/bridge-group/priority/node.def
@@ -0,0 +1,8 @@
+type: u32
+help: Set the path priority for this port
+comp_help: possible completions:
+ <0-255> Set port priority
+commit:expression: $VAR(../bridge/@) != ""; "interface must first be assigned to a bridge"
+create: sudo brctl setportprio $VAR(../bridge/@) $VAR(../../@) $VAR(@) ||
+ echo interfaces tunnel $VAR(../../@) bridge-group priority: error setting bridge priority
+delete: if [ -n "$( sudo brctl show | egrep "$VAR(../../@)" )" ]; then sudo brctl setportprio $VAR(../bridge/@) $VAR(../../@) 0; fi;
diff --git a/templates/interfaces/tunnel/node.tag/disable/node.def b/templates/interfaces/tunnel/node.tag/disable/node.def
index cd3c019a..26199646 100644
--- a/templates/interfaces/tunnel/node.tag/disable/node.def
+++ b/templates/interfaces/tunnel/node.tag/disable/node.def
@@ -1,6 +1,4 @@
help: Disable interface
-update:expression: "sudo ip link set $VAR(../@) down"; \
- "Error disabling dev $VAR(../@)"
+update: ip link set $VAR(../@) down
-delete:expression: "sudo ip link set $VAR(../@) up"; \
- "Error enabling dev $VAR(../@)"
+delete: ip link set $VAR(../@) up
diff --git a/templates/interfaces/tunnel/node.tag/encapsulation/node.def b/templates/interfaces/tunnel/node.tag/encapsulation/node.def
index 6b97b190..5374568c 100644
--- a/templates/interfaces/tunnel/node.tag/encapsulation/node.def
+++ b/templates/interfaces/tunnel/node.tag/encapsulation/node.def
@@ -1,13 +1,15 @@
type: txt
help: Set the encapsulation of this tunnel interface [REQUIRED]
-syntax:expression: $VAR(@) in "ipip", "gre", "sit"; "Must be (ipip, gre, sit)"
+syntax:expression: $VAR(@) in "ipip", "gre", "sit", "gre-bridge"; "Must be (ipip, gre, gre-bridge, sit)"
create:expression: "true"
update:expression: "false" ; \
"Encapsulation can only be set at tunnel creation for $VAR(../@)"
-comp_help: "possible completions:
+comp_help: possible completions:
gre Set Generic Routing Encapsulation
+ gre-bridge Set Generic Routing Encapsulation bridge interface
ipip Set IP in IP encapsulation
sit Set Simple Internet Transition encapsulation
+
diff --git a/templates/interfaces/tunnel/node.tag/key/node.def b/templates/interfaces/tunnel/node.tag/key/node.def
index 1ece7642..c137107c 100644
--- a/templates/interfaces/tunnel/node.tag/key/node.def
+++ b/templates/interfaces/tunnel/node.tag/key/node.def
@@ -3,7 +3,7 @@ help: Set the tunnel key
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 999999; \
"Must be between 0-999999 for $VAR(../@)"
syntax:expression: exec " \
- if [ -n \"`sudo ip tunnel show $VAR(../@) | grep $VAR(../@) `\" ]; then \
+ if [ -n \"`ip tunnel show $VAR(../@) | grep $VAR(../@) `\" ]; then \
echo Key can only be set at tunnel creation for $VAR(../@); \
exit 1 ; \
fi ; "
diff --git a/templates/interfaces/tunnel/node.tag/mtu/node.def b/templates/interfaces/tunnel/node.tag/mtu/node.def
index f1fdf39b..400533f9 100644
--- a/templates/interfaces/tunnel/node.tag/mtu/node.def
+++ b/templates/interfaces/tunnel/node.tag/mtu/node.def
@@ -1,7 +1,7 @@
type: u32
help: Set the tunnel Maximum Transmission Unit (MTU)
syntax:expression: $VAR(@) >= 64 && $VAR(@) <= 8024; "Must be between 64-8024"
-update:expression: "sudo ip link set $VAR(../@) mtu $VAR(@)"
-delete:expression: "sudo ip link set $VAR(../@) mtu 1476"
+update: ip link set $VAR(../@) mtu $VAR(@)
+delete: ip link set $VAR(../@) mtu 1476
comp_help: possible completions:
<64-8024> Set MTU
diff --git a/templates/interfaces/tunnel/node.tag/tos/node.def b/templates/interfaces/tunnel/node.tag/tos/node.def
index 1f739966..58a4cee0 100644
--- a/templates/interfaces/tunnel/node.tag/tos/node.def
+++ b/templates/interfaces/tunnel/node.tag/tos/node.def
@@ -1,7 +1,7 @@
type: u32
help: Set the tunnel Type of Service (TOS)
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 99; "Must be between 0-99"
-update:expression: "sudo ip tunnel change $VAR(../@) tos $VAR(@)"
-delete:expression: "sudo ip tunnel change $VAR(../@) tos inherit"
+update: ip tunnel change $VAR(../@) tos $VAR(@)
+delete: ip tunnel change $VAR(../@) tos inherit
comp_help: possible completions
<0-99> Set type of service
diff --git a/templates/interfaces/tunnel/node.tag/ttl/node.def b/templates/interfaces/tunnel/node.tag/ttl/node.def
index 298c4d61..cfab7264 100644
--- a/templates/interfaces/tunnel/node.tag/ttl/node.def
+++ b/templates/interfaces/tunnel/node.tag/ttl/node.def
@@ -1,8 +1,8 @@
type: u32
-help: Set the tunnel time to live field
default: 255
-syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 255; "Must be between 0-255"
-update:expression: "sudo ip tunnel change $VAR(../@) ttl $VAR(@)"
-delete:expression: "sudo ip tunnel change $VAR(../@) ttl inherit"
+help: Set the tunnel time to live field
comp_help: possible completions:
<0-255> Set time to live (default 255)
+syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 255; "Must be between 0-255"
+update:if [ "$VAR(../encapsulation/@)" != "gre-bridge" ]; then sudo ip tunnel change $VAR(../@) ttl $VAR(@); fi;
+delete:if [ "$VAR(../encapsulation/@)" != "gre-bridge" ]; then sudo ip tunnel change $VAR(../@) ttl inherit; fi;
diff --git a/templates/service/snmp/community/node.tag/client/node.def b/templates/service/snmp/community/node.tag/client/node.def
index 828faa97..427a9939 100644
--- a/templates/service/snmp/community/node.tag/client/node.def
+++ b/templates/service/snmp/community/node.tag/client/node.def
@@ -1,3 +1,3 @@
multi:
-type: ipv4
+type: ipv4,ipv6
help: Set IP address of SNMP client allowed to contact system
diff --git a/templates/service/snmp/community/node.tag/network/node.def b/templates/service/snmp/community/node.tag/network/node.def
index 00a77d4b..4b80a51b 100644
--- a/templates/service/snmp/community/node.tag/network/node.def
+++ b/templates/service/snmp/community/node.tag/network/node.def
@@ -1,4 +1,4 @@
multi:
-type: ipv4net
+type: ipv4net,ipv6net
help: Set subnet of SNMP client(s) allowed to contact system
syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $VAR(@)"
diff --git a/templates/service/snmp/listen-address/node.def b/templates/service/snmp/listen-address/node.def
new file mode 100644
index 00000000..f234edc8
--- /dev/null
+++ b/templates/service/snmp/listen-address/node.def
@@ -0,0 +1,3 @@
+tag:
+type: ipv4,ipv6
+help: Set IP address to listen for incoming SNMP requests
diff --git a/templates/service/snmp/listen-address/node.tag/port/node.def b/templates/service/snmp/listen-address/node.tag/port/node.def
new file mode 100644
index 00000000..5a21b1d8
--- /dev/null
+++ b/templates/service/snmp/listen-address/node.tag/port/node.def
@@ -0,0 +1,3 @@
+type: u32
+default: 161
+help: Set port for SNMP service
diff --git a/templates/service/snmp/node.def b/templates/service/snmp/node.def
index 13b39fa7..2952eb34 100644
--- a/templates/service/snmp/node.def
+++ b/templates/service/snmp/node.def
@@ -1,6 +1,7 @@
priority: 980
help: Configure Simple Network Management Protocol (SNMP)
-commit:expression: $VAR(community/) != ""; "must configure a community"
+commit:expression: $VAR(community/) != "" || $VAR(community6/) != "" \
+ ; "must configure a community or community6"
delete: touch /tmp/snmp.$PPID
end:if [ -f "/tmp/snmp.$PPID" ]
diff --git a/templates/service/snmp/trap-source/node.def b/templates/service/snmp/trap-source/node.def
index d8add72c..61a8cd6a 100644
--- a/templates/service/snmp/trap-source/node.def
+++ b/templates/service/snmp/trap-source/node.def
@@ -1,2 +1,2 @@
-type: ipv4
+type: ipv4,ipv6
help: Set SNMP trap source address
diff --git a/templates/service/snmp/trap-target/node.def b/templates/service/snmp/trap-target/node.def
index 493484b7..561bc1ac 100644
--- a/templates/service/snmp/trap-target/node.def
+++ b/templates/service/snmp/trap-target/node.def
@@ -1,3 +1,3 @@
tag:
-type: ipv4
-help: Set IP address of trap target
+type: ipv4,ipv6
+help: Set address of trap target
diff --git a/templates/system/domain-name/node.def b/templates/system/domain-name/node.def
index 96ccc7ae..fa8527d9 100644
--- a/templates/system/domain-name/node.def
+++ b/templates/system/domain-name/node.def
@@ -4,7 +4,7 @@ help: Set system domain name
syntax:expression: pattern $VAR(@) "^[-a-zA-Z0-9.]{0,63}$" ; "invalid domain name $VAR(@)"
# also add localhost line into /etc/hosts (see host-name template)?
-update:expression: "sudo /opt/vyatta/sbin/vyatta_update_resolv.pl"
+update: sudo /opt/vyatta/sbin/vyatta_update_resolv.pl
# also update localhost line in /etc/hosts (see host-name template)?
-delete:expression: "sudo /opt/vyatta/sbin/vyatta_update_resolv.pl"
+delete: sudo /opt/vyatta/sbin/vyatta_update_resolv.pl