GithubHelp home page GithubHelp logo

openwrt's People

Watchers

 avatar

openwrt's Issues

openwrt有线网速慢的解决办法

刷了openwrt之后,网速一直不稳定,以为是固件问题,刷了多个openwrt固件都没有明显改善,试了多种办法都没有作用,偶尔看到一位网友解决网络经常中断的方法,试过后竟然神奇的恢复满速。

网络环境:移动网络300M,光猫改桥接,K3 PPPOE拨号上网。无线能基本跑满网速。
常规方法1(实测无效):网络-防火墙-自定义规则下增加一行 iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
常规方法2(实测无效):系统-软件包-搜索mwan3-卸载 重启路由器

自用方法3(实测有效)):网络-接口-WAN-高级设置,重设MTU值修改为1492(默认值是1500),重启路由器。以下方法详细内容来自于 Pop's Blog

原理:MTU (最大传输单元)是网络设备传输的信息包最大值。对于各种路由器,最佳的MTU值通常都是默认值。

各种应用下的最佳MTU值
设置MTU大小是一个反复试验的过程: 由最大值1500开始下降,直至问题解决。使用下列值之一或许能解决一些由MTU值引起的问题:
1500. 以太网信息包最大值,也是默认值。是没有PPPoE的网络连接的典型设置。是各种路由器、网络适配器和交换机的默认设置
1492. PPPoE 的最佳值
1472. 使用 ping 的最大值 (大于此值的信息包会先被分解)
1468. DHCP的最佳值
1430. PPTP 的最佳值
576. 拨号连接到ISP的标准值
好了,注意一下,以上资料是正常普通情况下MTU的值,不同地区不同运营商不同机房或许也会导致MTU值的不一致!
如何查看MTU值呢?
电脑直接插网线到modem进行ADSL拨号上网,在cmd命令下输入:
netsh interface ipv4 show subinterfaces
如何测试MTU值的最大值?
MTU值越大,发包量就大,发包时间减小,理论上是可以提高网络的。怎样测试自己的MTU值的最大值呢?
首先,在CMD命令下输入:
ping -f -l 1500 www.baidu.com
1500是默认值,先来测试一下是否能达到1500.
命令返回:“需要拆分数据包但是设置 DF。” 说明MTU值过大!我们把MTU值降低试试

ping -f -l 1450 www.baidu.com
PING值出来了,说明MTU设置1450可以通过。

再测试一下1451。
ping -f -l 1451 www.baidu.com
命令返回:“需要拆分数据包但是设置 DF。” 说明MTU值最大就是1450了。
132619lwadav5kru5qi9z5
133020u6qkt00e7nqwe677

155412rshrqhuu79qzx7yr
其实在修改光猫的路由模式为桥接模式应该注意到,光猫拨号的界面显示mtu为1492,所以路由器拨号也改为1492就可以了。
但是我试过路由器拨号不改变默认设置1500也没问题,不影响网速。原因应该是防火墙wan的区域设置中默认开起了mss钳制,可能是你之前默认1500时WAN口还有 mss钳制 没有勾选启用,你的常规方法一所述的语句只打开ip伪装(即nat),印象中mss钳制就是会作MTU不匹配时的修复。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.