diff --git a/man/systemd.network.xml b/man/systemd.network.xml index cbf53f323a..31af7cfa98 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -1167,6 +1167,7 @@ When true, the interface maximum transmission unit from the DHCP server will be used on the current link. + If MTUBytes= is set, then this setting is ignored. Defaults to false. diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index 77ba8c678e..c61614f1c8 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -281,6 +281,12 @@ static int network_load_one(Manager *manager, const char *filename) { if (network->ip_masquerade) network->ip_forward |= ADDRESS_FAMILY_IPV4; + if (network->mtu > 0 && network->dhcp_use_mtu) { + log_warning("MTUBytes= in [Link] section and UseMTU= in [DHCP] section are set in %s. " + "Disabling UseMTU=.", filename); + network->dhcp_use_mtu = false; + } + LIST_PREPEND(networks, manager->networks, network); r = hashmap_ensure_allocated(&manager->networks_by_name, &string_hash_ops);