summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2015-02-15 05:20:44 +0100
committerDaniil Baturin <daniil@baturin.org>2015-02-15 05:20:44 +0100
commit13d64226876ea325b8f32d410452ded6ad65e529 (patch)
tree62eb2b368deec5f8b45cdb0207e92f6a4abbf711 /templates
parente8f156f129057427a59d162a11c414525f6495ac (diff)
parentddf9a933451f639edc15d669c0c32b15cc0a2717 (diff)
downloadvyatta-cfg-system-13d64226876ea325b8f32d410452ded6ad65e529.tar.gz
vyatta-cfg-system-13d64226876ea325b8f32d410452ded6ad65e529.zip
Merge branch 'lithium' of github.com:vyos/vyatta-cfg-system into lithium
Diffstat (limited to 'templates')
-rw-r--r--templates/interfaces/bonding/node.tag/vif-s/node.def16
-rw-r--r--templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def26
-rw-r--r--templates/interfaces/ethernet/node.tag/vif-s/node.def17
-rw-r--r--templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def27
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def11
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def21
-rw-r--r--templates/interfaces/tunnel/node.def7
-rw-r--r--templates/service/dns/dynamic/interface/node.tag/use-web/node.def1
-rw-r--r--templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def2
-rw-r--r--templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def2
-rw-r--r--templates/service/dns/forwarding/domain/node.tag/server/node.def1
-rw-r--r--templates/system/console/device/node.tag/speed/node.def5
-rw-r--r--templates/system/ipv6/disable-forwarding/node.def2
13 files changed, 103 insertions, 35 deletions
diff --git a/templates/interfaces/bonding/node.tag/vif-s/node.def b/templates/interfaces/bonding/node.tag/vif-s/node.def
index 5a2e8dee..dcec3900 100644
--- a/templates/interfaces/bonding/node.tag/vif-s/node.def
+++ b/templates/interfaces/bonding/node.tag/vif-s/node.def
@@ -5,14 +5,8 @@ help: QinQ TAG-S Virtual Local Area Network (VLAN) ID
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094"
val_help: u32:0-4094; VLAN ID
-create: read -a SLAVES </sys/class/net/$VAR(../@)/bonding/slaves
- if [ ${#SLAVES[*]} -eq 0 ]; then
- echo "Must configure slave devices for bond interface $VAR(../@) before adding vif"
- exit 1
- fi
- ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@) || exit 1
- ip link set "$VAR(../@).$VAR(@)" up
- /opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on
-
-delete: [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0
- ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@)
+delete: ETHERTYPE=`echo "$VAR(ethertype/@)"`
+ if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi
+ if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi
+ [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0
+ ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto $ETHTYPE id $VAR(@)
diff --git a/templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def
new file mode 100644
index 00000000..a79acae4
--- /dev/null
+++ b/templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def
@@ -0,0 +1,26 @@
+type: txt
+help: Set Ethertype
+syntax:expression: $VAR(@) in "0x88A8", "0x8100";"Must be (0x88A8 0x8100)\n"
+default: "0x88A8"
+
+comp_help: possible completions:
+ 0x88A8 802.1AD
+ 0x8100 802.1Q
+
+update: ACTIVEETHTYPE=`cli-shell-api returnActiveValue interfaces bonding $VAR(../../@) vif-s $VAR(../@) ethertype`
+ if [ ! -z $VAR(../vif-c/@@) ] && [ ! -z $ACTIVEETHTYPE ]
+ then echo "Can not change ethertype with vif-c configured"
+ exit 1
+ fi
+ ETHERTYPE=`echo "$VAR(@)"`
+ if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi
+ if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi
+ read -a SLAVES </sys/class/net/$VAR(../../@)/bonding/slaves
+ if [ ${#SLAVES[*]} -eq 0 ]; then
+ echo "Must configure slave devices for bond interface $VAR(../@) before adding vif"
+ exit 1
+ fi
+ ip link delete dev "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) > /dev/null 2>&1
+ ip link add link $VAR(../../@) name "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) || exit 1
+ ip link set "$VAR(../../@).$VAR(../@)" up
+ /opt/vyatta/sbin/vyatta-link-detect "$VAR(../../@).$VAR(../@)" on
diff --git a/templates/interfaces/ethernet/node.tag/vif-s/node.def b/templates/interfaces/ethernet/node.tag/vif-s/node.def
index 0a4ed145..c6483ac0 100644
--- a/templates/interfaces/ethernet/node.tag/vif-s/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif-s/node.def
@@ -5,15 +5,8 @@ help: QinQ TAG-S Virtual Local Area Network (VLAN) ID
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094"
val_help: u32:0-4094; VLAN ID
-create: if ! ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan proto 802.1ad 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 ip link set "$VAR(../@).$VAR(@)" up
- fi
- /opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on
-
-delete: [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0
- ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@)
+delete: ETHERTYPE=`echo "$VAR(ethertype/@)"`
+ if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi
+ if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi
+ [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0
+ ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto $ETHTYPE id $VAR(@)
diff --git a/templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def
new file mode 100644
index 00000000..0a5e954a
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def
@@ -0,0 +1,27 @@
+type: txt
+help: Set Ethertype
+syntax:expression: $VAR(@) in "0x88A8", "0x8100";"Must be (0x88A8 0x8100)\n"
+default: "0x88A8"
+
+comp_help: possible completions:
+ 0x88A8 802.1AD
+ 0x8100 802.1Q
+
+update: ACTIVEETHTYPE=`cli-shell-api returnActiveValue interfaces ethernet $VAR(../../@) vif-s $VAR(../@) ethertype`
+ if [ ! -z $VAR(../vif-c/@@) ] && [ ! -z $ACTIVEETHTYPE ]
+ then echo "Can not change ethertype with vif-c configured"
+ exit 1
+ fi
+ ETHERTYPE=`echo "$VAR(@)"`
+ if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi
+ if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi
+ ip link delete dev "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) > /dev/null 2>&1
+ if ! ip link add link $VAR(../../@) name "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE 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 ip link set "$VAR(../../@).$VAR(../@)" up
+ fi
+ /opt/vyatta/sbin/vyatta-link-detect "$VAR(../../@).$VAR(../@)" on
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def
index 0b867411..c4bc9577 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def
@@ -5,9 +5,8 @@ help: QinQ TAG-S Virtual Local Area Network (VLAN) ID
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094"
val_help: u32:0-4094; VLAN ID
-create: ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@) || exit 1
- ip link set "$VAR(../@).$VAR(@)" up
- /opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on
-
-delete: [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0
- ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@)
+delete: ETHERTYPE=`echo "$VAR(ethertype/@)"`
+ if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi
+ if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi
+ [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0
+ ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto $ETHTYPE id $VAR(@)
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def
new file mode 100644
index 00000000..9e2d5a54
--- /dev/null
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def
@@ -0,0 +1,21 @@
+type: txt
+help: Set Ethertype
+syntax:expression: $VAR(@) in "0x88A8", "0x8100";"Must be (0x88A8 0x8100)\n"
+default: "0x88A8"
+
+comp_help: possible completions:
+ 0x88A8 802.1AD
+ 0x8100 802.1Q
+
+update: ACTIVEETHTYPE=`cli-shell-api returnActiveValue interfaces pseudo-ethernet $VAR(../../@) vif-s $VAR(../@) ethertype`
+ if [ ! -z $VAR(../vif-c/@@) ] && [ ! -z $ACTIVEETHTYPE ]
+ then echo "Can not change ethertype with vif-c configured"
+ exit 1
+ fi
+ ETHERTYPE=`echo "$VAR(@)"`
+ if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi
+ if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi
+ ip link delete dev "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) > /dev/null 2>&1
+ ip link add link $VAR(../../@) name "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) || exit 1
+ ip link set "$VAR(../../@).$VAR(../@)" up
+ /opt/vyatta/sbin/vyatta-link-detect "$VAR(../../@).$VAR(../@)" on
diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def
index f7ffd746..795168f6 100644
--- a/templates/interfaces/tunnel/node.def
+++ b/templates/interfaces/tunnel/node.def
@@ -40,6 +40,9 @@ create:
echo "interfaces tunnel $VAR(@): Tunnel encapsulation type must be gre-bridge if a bridge group is defined";
exit 1;
fi
+ if [ -z "$VAR(./parameters/ip/tos/@)" ]; then
+ TOS="tos inherit"
+ fi
if [ -z "$VAR(./parameters/ip/ttl/@)" ]; then
TTL="ttl 255"
fi
@@ -47,9 +50,9 @@ create:
KEY="key $VAR(./parameters/ip/key/@)";
fi
if [ "$VAR(./encapsulation/@)" == "gre" ] && [ -z $VAR(./remote-ip/) ]; then
- ip tunnel add $VAR(@) local $VAR(./local-ip/@) mode gre $KEY $TTL
+ ip tunnel add $VAR(@) local $VAR(./local-ip/@) mode gre $KEY $TTL $TOS
else
- ip tunnel add $VAR(@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) mode $VAR(./encapsulation/@) $KEY $TTL
+ ip tunnel add $VAR(@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) mode $VAR(./encapsulation/@) $KEY $TTL $TOS
fi
if [ -z "`ip tun sh | grep $VAR(@)`" ]; then
echo interfaces tunnel $VAR(@): error creating tunnel interface
diff --git a/templates/service/dns/dynamic/interface/node.tag/use-web/node.def b/templates/service/dns/dynamic/interface/node.tag/use-web/node.def
new file mode 100644
index 00000000..f1b86b6d
--- /dev/null
+++ b/templates/service/dns/dynamic/interface/node.tag/use-web/node.def
@@ -0,0 +1 @@
+help: Web check used for obtaining the external IP address
diff --git a/templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def b/templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def
new file mode 100644
index 00000000..f316a4b5
--- /dev/null
+++ b/templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def
@@ -0,0 +1,2 @@
+help: Skip everything before this on the given URL
+type: txt
diff --git a/templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def b/templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def
new file mode 100644
index 00000000..164ddde4
--- /dev/null
+++ b/templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def
@@ -0,0 +1,2 @@
+help: URL to obtain the current external IP address
+type: txt
diff --git a/templates/service/dns/forwarding/domain/node.tag/server/node.def b/templates/service/dns/forwarding/domain/node.tag/server/node.def
index 3dec7d5d..8f40a299 100644
--- a/templates/service/dns/forwarding/domain/node.tag/server/node.def
+++ b/templates/service/dns/forwarding/domain/node.tag/server/node.def
@@ -1,2 +1,3 @@
+multi:
type: ipv4
help: DNS server to forward queries
diff --git a/templates/system/console/device/node.tag/speed/node.def b/templates/system/console/device/node.tag/speed/node.def
index 8453f67d..e7515dca 100644
--- a/templates/system/console/device/node.tag/speed/node.def
+++ b/templates/system/console/device/node.tag/speed/node.def
@@ -1,6 +1,5 @@
type: u32
help: Console baud rate
-default: 9600
allowed: echo 1200 2400 4800 9600 19200 38400 57600 115200
syntax:expression: $VAR(@) in 1200, 2400, 4800, 9600, 19200, 38400, \
57600, 115200 ; "unknown baud rate"
@@ -8,9 +7,9 @@ syntax:expression: $VAR(@) in 1200, 2400, 4800, 9600, 19200, 38400, \
val_help: 1200; 1200 bps
val_help: 2400; 2400 bps
val_help: 4800; 4800 bps
-val_help: 9600; 9600 bps (default)
+val_help: 9600; 9600 bps (default for serial console)
val_help: 19200; 19,200 bps
-val_help: 38400; 38,400 bps
+val_help: 38400; 38,400 bps (default for Xen console)
val_help: 57600; 57,600 bps
val_help: 115200; 115,200 bps
diff --git a/templates/system/ipv6/disable-forwarding/node.def b/templates/system/ipv6/disable-forwarding/node.def
index 5e689c5b..323b99d6 100644
--- a/templates/system/ipv6/disable-forwarding/node.def
+++ b/templates/system/ipv6/disable-forwarding/node.def
@@ -38,7 +38,7 @@ delete:
# forwarding was disabled, we will need to start the radvd daemon
# now.
running=$(pgrep -n radvd)
- if [[ $running -eq 0 ]] &&
+ if [[ -z "$running" ]] &&
[[ -e /etc/radvd.conf ]] &&
[[ -x /etc/init.d/radvd ]]; then
/etc/init.d/radvd start