Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

set_mtu doesn't work without dhcp #19

Open
metron2 opened this issue Jul 27, 2020 · 0 comments
Open

set_mtu doesn't work without dhcp #19

metron2 opened this issue Jul 27, 2020 · 0 comments

Comments

@metron2
Copy link

metron2 commented Jul 27, 2020

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant