canonical / lxd

Powerful system container and virtual machine manager
https://canonical.com/lxd
GNU Affero General Public License v3.0
4.32k stars 927 forks source link

curl TLS hangshake hangs with some URI when using fan network and VM #11063

Closed mrosset closed 1 year ago

mrosset commented 1 year ago

Required informationcurl

TLS hangshake hangs with some URI when using fan network and VM

Issue description

I've discovered a strange situation that only occurs when using a fan network and certain https URI's.

This command should not timeout.

curl -L -v https://raw.githubusercontent.com/getumbrel/umbrel/master/scripts/install

Steps to reproduce

  1. Create a new lxd cluster with defaults and a fan network
  2. Launch a new VM lxc launch images:ubuntu/jammy/cloud debug --vm
  3. install curl lxc exec debug -- apt install -y curl
  4. curl will time out using this URI lxc exec debug -- curl -L -v https://raw.githubusercontent.com/getumbrel/umbrel/master/scripts/install

Attached output for lxc info lxc.txt

stgraber commented 1 year ago

Sounds like an MTU problem, what's the link mtu you're getting inside the containers?

mrosset commented 1 year ago

Hello @stgraber thanks for the response. The MTU is 1500 I increased it to 2800 but it still hangs while handshaking.

Were you able to replicate this at all?

stgraber commented 1 year ago

Other way around, the MTU in your containers should be lower than 1500 when using the fan. You can try 1400 which will be a bit too low but should work fine.

mrosset commented 1 year ago

My mistake. setting the MTU to 1400 does solve the problem now.

What do you recommend for setting MTU for VM's that use fan? I can hack something together but I'd prefer a more top down way to set this if I could.

tomponline commented 1 year ago

If you are using lxds dhcp server then it will broadcast the MTU setting from the network as part of the dhcp responses and the instances should configure themselves that way.

mrosset commented 1 year ago

Thanks for closing the issue. I'll look into why the MTU is not being set properly later. My cluster is kinda adhoc. I'm transitioning from using zerotier to fan which should make this easier to sort out. Appreciate the help and all the work @stgraber