bestlong 怕失憶論壇

 

 

搜索
bestlong 怕失憶論壇 論壇 Linux 系統日誌出現很多 pppoe Bad TCP checksum 訊息 ...
查看: 4186|回復: 2
go

系統日誌出現很多 pppoe Bad TCP checksum 訊息 [複製鏈接]

Rank: 9Rank: 9Rank: 9

1#
發表於 2012-2-3 08:44 |只看該作者 |倒序瀏覽 |打印
在 fedora 13 的主機環境,檢查系統日誌 /var/log/messages 的內容時發現一堆訊息如下:

Jan 29 13:52:56 www pppoe[1558]: Bad TCP checksum b519
Jan 29 15:03:01 www pppoe[1558]: Bad TCP checksum 50f9
Jan 29 15:24:16 www pppoe[1558]: Bad TCP checksum d799
...

此主機是用撥接方式來取得固定 IP 的模式

用 vim 檢視網路設定內容
[root at www.bestlong.idv.tw ~]# vim /etc/sysconfig/network-scripts/ifcfg-ppp0
內容如下

USERCTL=yes
BOOTPROTO=dialup
NAME=DSLppp0
DEVICE=ppp0
TYPE=xDSL
ONBOOT=yes
PIDFILE=/var/run/pppoe-adsl.pid
FIREWALL=NONE
PING=.
PPPOE_TIMEOUT=80
LCP_FAILURE=3
LCP_INTERVAL=20
CLAMPMSS=1412
CONNECT_POLL=6
CONNECT_TIMEOUT=60
DEFROUTE=yes
SYNCHRONOUS=no
ETH=eth1
PROVIDER=DSLppp0
USER=tXXXXXXX#
PEERDNS=yes
DEMAND=no


關於 pppoe 的連線狀態
[root at www.bestlong.idv.tw ~]# pppoe-status
pppoe-status: Link is up and running on interface ppp0
74: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc pfifo_fast state UNKNOWN qlen 3
    link/ppp
    inet 123.204.43.111 peer 123.204.43.1/32 scope global ppp0
[root at www.bestlong.idv.tw ~]#
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw

Rank: 9Rank: 9Rank: 9

2#
發表於 2012-2-3 15:53 |只看該作者
資料來源 http://note.tcc.edu.tw/321.html

Syslog pppoe Bad TCP checksum 值的問題

設定為 syslog 後,發現這個訊息一直出來,主要的訊息只有一行 「Bad TCP checksum 值」

主機 [webmail] 記錄時間 2009-12-29 03:38:55 機構 daemon 等級 err 程式 pppoe
訊息內容 Bad TCP checksum a432
於是我 google 了一下,發現要在 pppoe.conf 設定 "CLAMPMSS=no" 方可。

資料來源.. http://plasma-gate.weizmann.ac.i ... 03/09/msg00067.html

Here is what i found (if it hasn't been found before):

1) solved by editing the pppoe.conf and setting "CLAMPMSS=no"
   also, you need to use the internal CLAMPMSS of netfilter to compensate (if you don't already.):

$iptdir -t filter -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

2) the reason it (usually) happens is because you have the CLAMPMSS set to 1412 and you have also set netfilter to:

$iptdir -t filter -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

at the same time. choose one, preferably leave netfilter in place to avoid freezes at unexpected time.

3) The reason it happens is because you have short circuted the modem to the hub and the pppoe protocol or software have trouble keeping things in sync because of timeouts that were generated by the network collisions. the solution is to seperate the modem network from the home network so no collisions will happen.

however, the CLAMPMSS=no could also help since it can reduce overheads and thus lower timeouts (if any)though i didn't check that. other things can help like increasing timeouts, changing synchronization options but i didn't try them and it seems too much hassle, it would be cheaper by time/money to just buy another 30 nis ethernet card and be done with it.

因此我修改了我的系統( OS Linux webmail.tcc.edu.tw 2.6.9-78.0.8.ELsmp #1 SMP 2008 )

我們設定存在 /etc/sysconfig/network-scripts/ifcfg-ppp0 修改成:

CLAMPMSS=no
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw

Rank: 9Rank: 9Rank: 9

3#
發表於 2012-2-3 15:59 |只看該作者
資料來源 http://ppc52776.blogspot.com/2011/04/mss-linux-pppoe-nat.html

修改 MSS 解決 Linux PPPOE NAT 後部份網頁無法瀏覽問題

有用 Linux 當作家裡 ADSL 分享器/防火牆 的人應該會發現
有些網頁透過 NAT 後就是無法開啟
但是如果直接在 Linux 主機上卻又可以正常開啟
解決方法:
在 Linux Firewall 上增加以下 rule:

iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

搞定

為什麼呢?

這主要原因是因為 ppp 網路的 MTU 問題
MTU 的功能在於指定最大可傳輸的單一封包大小
當使用 ADSL(PPP) 時
會再封包裡另外增加 PPP 的 Header 導致單一封包會超過上限
為了解決此問題
一般會把 PPP 的 MTU 設定為原本 Ethernet MTU - 8 也就是 1492

TCP 傳輸方式有自動切割與組合封包的特性
MTU 的值就會被拿來當作 TCP 預設切割的大小(MSS)
MSS = Maximum Segment Size
每次建立 TCP 連線時
雙方會於 handshaking 時互相告知對方允許的 MSS 最後以小的為主
但 NAT 後的 PC 看到的是自己的 MTU 也就是 1500 而非 1492
因此會給對方過大的 MSS 建議
正常來說~當路由器收到大於自己可處理最大封包時
會透過 ICMP 回應給 sender
sender 接下來就會嘗試較小的 MSS
但大多數 ISP 會擋掉 ICMP 導致 sender 傻傻一直等待直到 timeout...

參考資料:
How to Setup a Linux Firewall with PPPoE/NAT/iptables
http://www.akadia.com/services/pppoe_iptables.html
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw
‹ 上一主題|下一主題

Archiver|怕失憶論壇

GMT+8, 2024-4-20 07:04 , Processed in 0.029160 second(s), 18 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.