Now this sounds like it should be really easy, but … I need to be able to set the MTU of an instance independently of the Network MTU. Does anyone have a way of doing this?
I have a situation where my instances are running on an OVN network, which is then using OVN-IC to connect to a remote OVN cluster, over a VPN … so I have multiple layers of MTU and of course OVS/OVN doesn’t do fragmentation properly and silently drops anything oversized - so the MTU has to work. Whereas it should be possible to calculate the correct MTU and assign it to the network, this doesn’t seem to fly. The instance MTU seems to need to be consistently less than the network MTU to work, if I lower the network MTU to 1200, the instance MTU then needs to be around 1100.
My solution is to use the default network MTU of 1442, then set the instance MTU at 1200 with;
ifconfig eth0 mtu 1200 # in the instance
While this may not be 100% efficient, it does appear to be 100% reliable. My issue is how to set the MTU automatically after the instance is started. If I try to add MTU to the profile it complains that “mtu” is not allowed with devices of type “network”.
# incus profile show default
config: {}
description: Default Incus profile
devices:
eth0:
network: private
type: nic
# I want to put "mtu: 1200" here ...
root:
path: /
pool: default
type: disk
name: default
used_by:
- /1.0/instances/npm
- /1.0/instances/demo
project: default
Unfortunately I’m using a mix of containers including OCI so cloud-init isn’t going to work because it’s not always available. (I don’t always have “ip” or “ifconfig” for that matter) I was hoping it could be set via DHCP but I can’t seem to find any reference to how to do it …
Anybody know the answer or have anything I could try?
(does anyone know why having the instance MTU == the OVN network MTU doesn’t work?)