MTU 不断重置为 1500

MTU 不断重置为 1500

我在跑OpenSuse 风滚草侏儒 3.22


我需要将 MTU 设置为 1472。如果我这样做:

ip link set mtu 1472 dev ppp0

有用:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 88:ae:1d:59:7c:1a brd ff:ff:ff:ff:ff:ff
inet6 fe80::2c7:1e3d:2a85:7a43/64 scope link 
   valid_lft forever preferred_lft forever
3: wlp6s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 5a:37:1f:84:93:99 brd ff:ff:ff:ff:ff:ff
16: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1472 qdisc pfifo_fast state UNKNOWN group default qlen 3
link/ppp 
inet 31.176.245.43 peer 109.175.48.1/32 scope global ppp0
   valid_lft forever preferred_lft forever

但是当我打开 NetworkManager 并重新启动连接时,我又回到了 1500...

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 88:ae:1d:59:7c:1a brd ff:ff:ff:ff:ff:ff
inet6 fe80::2c7:1e3d:2a85:7a43/64 scope link 
   valid_lft forever preferred_lft forever
3: wlp6s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 5a:37:1f:84:93:99 brd ff:ff:ff:ff:ff:ff
17: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 3
link/ppp 
inet 92.36.220.222 peer 109.175.48.1/32 scope global ppp0
   valid_lft forever preferred_lft forever

我也尝试编辑该文件/etc/ppp/options但无济于事。

从 NetworkManager GUI 中设置 MTU 也不起作用。

答案1

好的,我找不到任何有效的配置,但可以将调度程序脚本添加到/etc/NetworkManager/dispatcher.d目录中。

添加类似的内容:

#!/bin/bash

ip link set mtu 1472 dev ppp0

应该做这项工作。

不过,这应该可以通过配置文件实现,不是吗?

下面的配置文件/etc/NetworkManager/system-connections不起作用。它们也可以在 GUI 中进行编辑。

相关内容