From b557e1b2a8e2a8c15cbb7552cbce70321cf12a96 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 29 Oct 2010 15:58:49 -0700 Subject: Allow setting MTU of VIF Bug 3531 --- .../interfaces/bonding/node.tag/vif/node.tag/mtu/node.def | 10 ++++++++++ .../interfaces/ethernet/node.tag/vif/node.tag/mtu/node.def | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 templates/interfaces/bonding/node.tag/vif/node.tag/mtu/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif/node.tag/mtu/node.def (limited to 'templates/interfaces') 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 -- cgit v1.2.3