This repository was archived by the owner on Jan 21, 2022. It is now read-only.
This repository was archived by the owner on Jan 21, 2022. It is now read-only.
set_mtu doesn't work without dhcp #19
Open
Description
On vsphere set_mtu does nothing because bosh uses manual ip assignment. I'm not sure why this job doesn't warn people that it only works with dhcp.
What would you think about changing this to use udev rules? Here's a replacement template
#!/bin/bash
set -eu
INTERFACE=<%= p('networking.set_mtu.interface') %>
MTU=<%= p('networking.set_mtu.mtu') %>
UDEV_RULE=/etc/udev/rules.d/70-networking-set_mtu-$INTERFACE.rules
# Override MTU setting
cat <<EOF > ${UDEV_RULE}
SUBSYSTEM=="net", ATTR{name}=="${INTERFACE}",RUN+="/sbin/ip link set mtu ${MTU} dev '%k'"
EOF
# Enable new MTU setting now
/sbin/ip link set mtu $MTU dev $INTERFACE
Metadata
Metadata
Assignees
Labels
No labels