7

debian更改mtu值

 1 year ago
source link: https://vpsxb.net/3650/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

debian更改mtu值 | VPS小白

> linux > debian更改mtu值
202206191902179.png

mtu: 最大传输单元,意思是网络上传输最大的数据包,mtu的单位是字节。大部分的网络设备的mtu值是1500。如果本机的mtu值大于网关的mtu值,大的数据包就会被拆开来传送,这样会产生数据包的碎片,增加丢包率,降低网络速度。把mtu设置比网关小或者相同,可以减少丢包。设置合适的mtu值,可以减少部分网站打不开,上网速度慢等问题。一般情况,可以把路由器、交换机和服务器的mtu值统一设置。

debian更改mtu的方法:

查看服务器的mtu值:

#cat /sys/class/net/eth0/mtu

临时修改mtu值:(重启服务器后失效)

#ifconfig eth0 mtu 9000

永久修改mtu值的方法:

修改 /etc/network/interface文件,添加一行mtu的配置,示例如下:

# The primary network interface
#allow-hotplug eth0
auto eth0
iface eth0 inet static
address 10.10.11.20
netmask 255.255.255.0
gateway 10.10.11.1
mtu 9000

重启网卡或者服务器生效。
————————————————
版权声明:本文为CSDN博主「mouyu230」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/mouyu230/article/details/41278775


VPS小白 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK