diff options
-rw-r--r-- | templates/interfaces/bonding/node.tag/vif/node.tag/mtu/node.def | 10 | ||||
-rw-r--r-- | templates/interfaces/ethernet/node.tag/vif/node.tag/mtu/node.def | 10 |
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 |