1. 确认options.pptpd有以下两行php
mtu 1440tcp
mru 1440ide
2. 须要添加一条iptables规则:post
iptables -I FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtuthis
这样就能够打开了。
另外,给出一个临时的解决方案,当mtu报错的时候能够直接了本地修改mtu值:spa
ifconfig ppp0 mtu 1440orm
关于这条命令的详细说明继续往下看
-------------------割
参考一个新的解决方案,在5#xml
iptables -A FORWARD -p tcp –syn -s 192.168.100.0/24 -j TCPMSS –set-mss 1356ip
This sounds like a common problem with MTU size.
If you're adding iptables rules to accept traffic then that's the cause.
Traffic must be clamped to the MTU size in iptables before it hits a rule that accepts it.
Post your firewall script, any ××× specific scripts that contain iptables rules, and the output of this command.ci
iptables -vnL FORWARD
You should be able to fix it by adding this command to the end of your ××× script or firewall script, whichever has your iptables rules that are accepting traffic.
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
有看到一种iptables的写法,这个大概能够不修改mtu?以下:
mtu:Maxitum Transmission Unit 最大传输单元。
mss:Maxitum Segment Size 最大分段大小。
mtu mss(应用层数据)+tcp包头+IP包头
mss大小是通信双方在创建TCP链接时根据双方提供的 MSS值的最小值肯定为此次链接的最大MSS值。
tcp数据包包头大小20Byte。
ip数据包包头大小20Byte。
若是超过mtu的大小就须要对ip报文进行分片。
若是ip报文中有DF(Donot Fragment)标记就表示不可分片。
若是报文超过MTU值又不能分片,就会丢弃报文,返回一个错误信息unreachable-need to frag(不可到达,须要分片)。 如图所示。
出现这种现象的解决办法以下:
修改数据报文的mss大小。
iptables -A FORWARD -p tcp –syn -s 192.168.100.0/24 -j TCPMSS –set-mss 1356
凡是来自192.168.100.0/24网段的tcp包,mss设置为1356.