今天新裝了Redhat 5.4企業版,配置了一下PPPoe,准備就駕著本本遨游了,可是令我奇怪的是,ppp的連接不停的掉線,新開一個終端,一直在Ping,發現網絡隔一分鐘左右就自動掉一次,然後自動重新連接,查看message日志,發現有如下內容,不斷重復:
Aug 5 23:20:53 localhost pppd[5754]: pppd 2.4.4 started by root, uid 0
Aug 5 23:20:53 localhost pppd[5754]: Using interface ppp0
Aug 5 23:20:53 localhost pppd[5754]: Connect: ppp0 <--> /dev/pts/0
Aug 5 23:20:53 localhost pppoe[5755]: PPP session is 33288
Aug 5 23:20:54 localhost pppd[5754]: appear to have received our own echo-reply!
Aug 5 23:20:54 localhost pppd[5754]: PAP authentication succeeded
Aug 5 23:20:54 localhost pppd[5754]: local IP address 10.0.0.59
Aug 5 23:20:54 localhost pppd[5754]: remote IP address 10.0.0.1
Aug 5 23:21:14 localhost pppd[5754]: appear to have received our own echo-reply!
Aug 5 23:21:34 localhost pppd[5754]: appear to have received our own echo-reply!
Aug 5 23:21:54 localhost pppd[5754]: No response to 3 echo-requests
Aug 5 23:21:54 localhost pppd[5754]: Serial link appears to be disconnected.
Aug 5 23:21:54 localhost pppd[5754]: Connect time 1.0 minutes.
Aug 5 23:21:54 localhost pppd[5754]: Sent 6578 bytes, received 13132 bytes.
Aug 5 23:21:54 localhost pppd[5754]: Connection terminated.
Aug 5 23:21:54 localhost pppoe[5755]: read (asyncReadFromPPP): Session 33288: Input/output error
Aug 5 23:21:54 localhost pppoe[5755]: Sent PADT
Aug 5 23:21:54 localhost pppd[5754]: Exit.
Aug 5 23:21:54 localhost adsl-connect: ADSL connection lost; attempting re-connection.
Aug 5 23:21:59 localhost pppd[5846]: pppd 2.4.4 started by root, uid 0
Aug 5 23:21:59 localhost pppd[5846]: Using interface ppp0
Aug 5 23:21:59 localhost pppd[5846]: Connect: ppp0 <--> /dev/pts/0
Aug 5 23:21:59 localhost pppoe[5847]: PPP session is 33544
Aug 5 23:21:59 localhost pppd[5846]: appear to have received our own echo-reply!
Aug 5 23:21:59 localhost pppd[5846]: PAP authentication succeeded
Aug 5 23:22:00 localhost pppd[5846]: local IP address 10.0.0.5
Aug 5 23:22:00 localhost pppd[5846]: remote IP address 10.0.0.1
Aug 5 23:22:19 localhost pppd[5846]: appear to have received our own echo-reply!
Aug 5 23:22:39 localhost pppd[5846]: appear to have received our own echo-reply!
Aug 5 23:22:59 localhost pppd[5846]: No response to 3 echo-requests
Aug 5 23:22:59 localhost pppd[5846]: Serial link appears to be disconnected.
Aug 5 23:22:59 localhost pppd[5846]: Connect time 1.0 minutes.
Aug 5 23:22:59 localhost pppd[5846]: Sent 31464 bytes, received 78172 bytes.
Aug 5 23:23:00 localhost pppd[5846]: Connection terminated.
Aug 5 23:23:00 localhost pppoe[5847]: read (asyncReadFromPPP): Session 33544: Input/output error
Aug 5 23:23:00 localhost pppoe[5847]: Sent PADT
Aug 5 23:23:00 localhost pppd[5846]: Exit.
本欄目更多精彩內容:http://www.bianceng.cn/OS/Linux/
隨即在網上搜了一下,發現網上出現此問題的人也不在少數,要麼修改/etc/ppp/options的內容,要麼就是修改/etc/ppp/pppoe-server-options的內容,我也在這兩個文件上浪費了挺多的時,測試了挺久時間,網絡狀況依然如故,後來一想,平常修改IP的設置之類的都在網卡上設置的,就試著在 vi /etc/sysconfig/network-scripts/ifcfg-ppp0 裡面作了修改,原文件如下:
USERCTL=no
BOOTPROTO=dialup
NAME=DSLppp0
DEVICE=ppp0
TYPE=xDSL
ONBOOT=no
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=eth0
PROVIDER=DSLppp0
USER=46804
PEERDNS=no
DEMAND=no
IPV6INIT=no
PERSIST=no
將此文件內的二個地方作了修改:
LCP_FAILURE=30
LCP_INTERVAL=30
至此,一直末出現不間斷掉線的情況了,其實將上面兩個語句的任意一個值,修改得大些即可解決問題。