summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-10-29 15:58:49 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-10-29 16:00:34 -0700
commitb557e1b2a8e2a8c15cbb7552cbce70321cf12a96 (patch)
tree474c8b520362d0e9f411b101689f8496a10f99e3 /templates
parentaa669cec4147e760ac417078e6a452ab0ad12762 (diff)
downloadvyatta-cfg-quagga-b557e1b2a8e2a8c15cbb7552cbce70321cf12a96.tar.gz
vyatta-cfg-quagga-b557e1b2a8e2a8c15cbb7552cbce70321cf12a96.zip
Allow setting MTU of VIF
Bug 3531
Diffstat (limited to 'templates')
-rw-r--r--templates/interfaces/bonding/node.tag/vif/node.tag/mtu/node.def10
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/mtu/node.def10
2 files changed, 20 insertions, 0 deletions
diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/mtu/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/mtu/node.def
new file mode 100644
index 00000000..b824b017
--- /dev/null
+++ b/templates/interfaces/bonding/node.tag/vif/node.tag/mtu/node.def
@@ -0,0 +1,10 @@
+type: u32
+help: Maximum Transmission Unit (MTU)
+val_help: u32:68-9000; Maximum Transmission Unit (MTU)
+syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000"
+commit:expression: $VAR(../../mtu) >= $VAR(@); \
+ "MTU of VIF must be not be greater than MTU of underlying device"
+
+update: ip link set $VAR(../../@).$VAR(../@) mtu $VAR(@)
+delete: [ -d /sys/class/net/$VAR(../../@).$VAR(../@) ] || exit 0
+ ip link set $VAR(../../@).$VAR(../@) mtu 1500
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/mtu/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/mtu/node.def
new file mode 100644
index 00000000..b824b017
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/mtu/node.def
@@ -0,0 +1,10 @@
+type: u32
+help: Maximum Transmission Unit (MTU)
+val_help: u32:68-9000; Maximum Transmission Unit (MTU)
+syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000"
+commit:expression: $VAR(../../mtu) >= $VAR(@); \
+ "MTU of VIF must be not be greater than MTU of underlying device"
+
+update: ip link set $VAR(../../@).$VAR(../@) mtu $VAR(@)
+delete: [ -d /sys/class/net/$VAR(../../@).$VAR(../@) ] || exit 0
+ ip link set $VAR(../../@).$VAR(../@) mtu 1500