fix: set default MTU on Azure to 1400

Azure documentation is very confusing, but the tests and the issues we
observed show that 1400 is a more safe default than 1500, reducing
packet fragmentation and timeouts.

See e.g. https://www.reddit.com/r/networking/comments/puowuy/do_anyone_know_the_default_tcp_mss_between_two/

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
This commit is contained in:
Andrey Smirnov 2025-06-27 19:20:20 +04:00
parent 091cd6989c
commit 6c7f8201a9
No known key found for this signature in database
GPG Key ID: FE042E3D4085A811
3 changed files with 37 additions and 2 deletions

View File

@ -52,6 +52,13 @@ This feature can be enable by using [SwapVolumeConfig](https://www.talos.dev/v1.
title = "VMware"
description = """\
Talos VMWare platform now supports `arm64` architecture in addition to `amd64`.
"""
[notes.azure]
title = "Azure"
description = """\
Talos on Azure now defaults to MTU of 1400 bytes for the `eth0` interface to avoid packet fragmentation issues.
The default MTU can be overriden with machine configuration.
"""
[make_deps]

View File

@ -124,6 +124,7 @@ func (a *Azure) ParseMetadata(metadata *ComputeMetadata, interfaceAddresses []Ne
DHCP6: network.DHCP6OperatorSpec{
RouteMetric: 2 * network.DefaultRouteMetric,
},
ConfigLayer: network.ConfigPlatform,
})
// If accept_ra is not set, use the default gateway.
@ -160,6 +161,22 @@ func (a *Azure) ParseMetadata(metadata *ComputeMetadata, interfaceAddresses []Ne
return nil, err
}
networkConfig.Operators = append(networkConfig.Operators, network.OperatorSpecSpec{
Operator: network.OperatorDHCP4,
LinkName: "eth0",
RequireUp: true,
ConfigLayer: network.ConfigPlatform,
})
networkConfig.Links = append(networkConfig.Links,
network.LinkSpecSpec{
Name: "eth0",
Up: true,
MTU: 1400,
ConfigLayer: network.ConfigPlatform,
},
)
networkConfig.Metadata = &runtimeres.PlatformMetadataSpec{
Platform: a.Name(),
Hostname: metadata.OSProfile.ComputerName,

View File

@ -1,5 +1,12 @@
addresses: []
links: []
links:
- name: eth0
logical: false
up: true
mtu: 1400
kind: ""
type: netrom
layer: platform
routes:
- family: inet6
dst: ""
@ -25,7 +32,11 @@ operators:
requireUp: true
dhcp6:
routeMetric: 2048
layer: default
layer: platform
- operator: dhcp4
linkName: eth0
requireUp: true
layer: platform
externalIPs:
- 1.2.3.4
- 2603:1020:10:5::34