MTU設定はsystemd-networkdでは機能しませんが、「ip link set mtu」では機能しません。

MTU設定はsystemd-networkdでは機能しませんが、「ip link set mtu」では機能しません。

MTUインターフェイスを変更しようとしています。
使用時に正しく変更されないことを確認しましたが、systemd-networkdコマンドip link set mtuを使用すると機能します。

現在MTU1500:

3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64 numtxqueues 8 numrxqueues 8 gso_max_size 65536 gso_max_segs 65535 

/etc/systemd/network/50_eth0.networkこれでファイルを変更し、以下を追加しました。

[Link]
MTUBytes = 1000

systemd-networkdサービスが再起動すると、syslog次の情報が表示されます。

Nov 30 23:36:20 me kernel: [84974.429088] igb 0000:00:14.0: changing MTU from 1500 to 1280

現在MTU1280:

3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1280 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64 numtxqueues 8 numrxqueues 8 gso_max_size 65536 gso_max_segs 65535 

ご覧のとおり、1000が欲しかったのに1280に変更されました。 IPv6の制限についてどこかで読んだようです。

ipツールを使用するとき:

ip link set mtu 1000 dev eth0

syslog:

Nov 30 23:36:44 me kernel: [84998.785039] igb 0000:00:14.0: changing MTU from 1280 to 1000

現在MTU1000個:

# ip -d link show dev eth0
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1000 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff promiscuity 0 numtxqueues 8 numrxqueues 8 gso_max_size 65536 gso_max_segs 65535 

なぜ1つのアプローチは機能し、他のアプローチは機能しないのですか?
ありがとうございます。

ベストアンサー1

ABの意見に基づいています。
実際、MTUBytesこの[Link]セクションの一部では、次のIPv6に関する注意事項について説明します。

MTUBytes=
The maximum transmission unit in bytes to set for the device. The usual suffixes K, M, G, are supported and are understood to the base of 1024.
Note that if IPv6 is enabled on the interface, and the MTU is chosen below 1280 (the minimum MTU for IPv6) it will automatically be increased to this value.

このインターフェイスのIPv6を無効にした後、MTUは1280未満です。このセクションの次のディレクティブを値とともに
使用して、このインターフェイスのIPv6を無効にしました。[Network]none

IPv6LinkLocalAddressGenerationMode=
Specifies how IPv6 link-local address is generated. Takes one of "eui64", "none", "stable-privacy" and "random". When unset, "stable-privacy" is used if IPv6StableSecretAddress= is specified, and if not, "eui64" is used. Note that if LinkLocalAddressing= is "no" or "ipv4", then IPv6LinkLocalAddressGenerationMode= will be ignored. Also, even if LinkLocalAddressing= is "yes" or "ipv6", setting IPv6LinkLocalAddressGenerationMode=none disables to configure an IPv6 link-local address.

おすすめ記事