1

I have a SR-IOV enabled debian which exposed 128 VF network interfaces. I would like to configure all of these VF with MTU=9000 and some other options, but won't like to copy same config line 127 times in /etc/network/interface file.

Is there any programmatic way to do a looping or similar configuration?

I have found a config directory in /etc/network/interface.d, but don't know how can I accomplish it?

Any advice are appreciated.

Ray Tracy
  • 13
  • 2

1 Answers1

0

You can add a hook to /etc/network/ifup.d containing something like:

#! /bin/sh echo "$IFACE" | grep -qs vf || exit 0 ip link set "$IFACE" mtu 9000

Make sure to make the hook executable, adjust the exact settings to what you want, adjust the grep to match the interfaces you want. The name of the hook also has to match the patterns required by run-parts.

Tollef Fog Heen
  • 692
  • 3
  • 10