![pppd 与 3G 断开连接,不重新连接,并设置持久连接](https://linux22.com/image/1239789/pppd%20%E4%B8%8E%203G%20%E6%96%AD%E5%BC%80%E8%BF%9E%E6%8E%A5%EF%BC%8C%E4%B8%8D%E9%87%8D%E6%96%B0%E8%BF%9E%E6%8E%A5%EF%BC%8C%E5%B9%B6%E8%AE%BE%E7%BD%AE%E6%8C%81%E4%B9%85%E8%BF%9E%E6%8E%A5.png)
我正在尝试配置 pppd 以连接到 3G 网络(在本例中为 Sprint),然后保持连接,如果远程连接终止,则自动重新连接。我已启用持久选项。我的配置文件如下:
hide-password
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/cellular"
debug
/dev/cell 921600
defaultroute
noipdefault
user " "
persist
maxfail 0
lcp-echo-failure 10
lcp-echo-interval 60
holdoff 5
但是,当对等方断开连接时,pppd 通常要等待很长时间(远远超过我的延迟时间)才能重新连接调制解调器 - 如果它真的重新连接的话!
显示此内容的示例日志:
May 23 05:17:24 00270e0a8888 pppd[2408]: rcvd [LCP TermReq id=0x26]
May 23 05:17:24 00270e0a8888 pppd[2408]: LCP terminated by peer
May 23 05:17:24 00270e0a8888 pppd[2408]: Connect time 60.1 minutes.
May 23 05:17:24 00270e0a8888 pppd[2408]: Sent 0 bytes, received 0 bytes.
May 23 05:17:24 00270e0a8888 pppd[2408]: Script /etc/ppp/ip-down started (pid 2456)
May 23 05:17:24 00270e0a8888 pppd[2408]: sent [LCP TermAck id=0x26]
May 23 05:17:24 00270e0a8888 pppd[2408]: Script /etc/ppp/ip-down finished (pid 2456), status = 0x0
May 23 05:17:24 00270e0a8888 pppd[2408]: Hangup (SIGHUP)
May 23 05:17:24 00270e0a8888 pppd[2408]: Modem hangup
May 23 05:17:24 00270e0a8888 pppd[2408]: Connection terminated.
May 23 05:17:24 00270e0a8888 pppd[2408]: Terminating on signal 15
May 23 05:17:24 00270e0a8888 pppd[2408]: Exit.
May 23 06:08:07 00270e0a8888 pppd[2500]: pppd 2.4.5 started by root, uid 0
May 23 06:08:10 00270e0a8888 pppd[2500]: Script /usr/sbin/chat -v -f /etc/chatscripts/cellular finished (pid 2530), status = 0x0
May 23 06:08:10 00270e0a8888 pppd[2500]: Serial connection established.
May 23 06:08:10 00270e0a8888 pppd[2500]: using channel 11
应对方要求断开连接的时间是 5:17,但直到 6:08 才重新连接。我有一个朋友在监控服务器,所以我不确定这不是手动重新连接。无论如何,要么花了将近一个小时才重新连接,要么从未重新连接。
persist
+难道不应该holdoff 5
导致链接终止 5 秒后自动重新连接吗?