pppd,本地和远程 IP 地址相同,无互联网访问

pppd,本地和远程 IP 地址相同,无互联网访问

我正在使用连接到嵌入式 Linux 平台的蜂窝调制解调器,并且正在通过蜂窝调制解调器建立数据连接。请注意,我之前的工作非常顺利,但我最近创建了一个新的系统映像,无法让它工作。操作系统是 Ubuntu 14.04.1、内核 3.16.2 和 pppd 2.4.5。

该问题似乎与将相同的 IP 地址分配给本地和远程 IP 地址有关,请参阅下面的系统日志:

Jun  1 11:11:30 arm pppd[2118]: pppd 2.4.5 started by root, uid 0
Jun  1 11:11:31 arm pppd[2118]: Script /usr/sbin/chat -vV -f /etc/ppp/chat-HSPA910CF-nopin finished (pid 2127), status = 0x0
Jun  1 11:11:31 arm pppd[2118]: Serial connection established.
Jun  1 11:11:31 arm pppd[2118]: using channel 1
Jun  1 11:11:31 arm pppd[2118]: Using interface ppp0
Jun  1 11:11:31 arm pppd[2118]: Connect: ppp0 <--> /dev/mux0
Jun  1 11:11:32 arm pppd[2118]: rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <auth pap> <magic 0x96a24aa4> <pcomp> <accomp>]
Jun  1 11:11:32 arm pppd[2118]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x2dc7c3aa> <pcomp> <accomp>]
Jun  1 11:11:32 arm pppd[2118]: No auth is possible
Jun  1 11:11:32 arm pppd[2118]: sent [LCP ConfRej id=0x1 <auth pap>]
Jun  1 11:11:32 arm pppd[2118]: rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x2dc7c3aa> <pcomp> <accomp>]
Jun  1 11:11:32 arm pppd[2118]: rcvd [LCP ConfReq id=0x2 <asyncmap 0x0> <magic 0x96a24aa4> <pcomp> <accomp>]
Jun  1 11:11:32 arm pppd[2118]: sent [LCP ConfAck id=0x2 <asyncmap 0x0> <magic 0x96a24aa4> <pcomp> <accomp>]
Jun  1 11:11:32 arm pppd[2118]: sent [LCP EchoReq id=0x0 magic=0x2dc7c3aa]
Jun  1 11:11:32 arm pppd[2118]: sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
Jun  1 11:11:32 arm pppd[2118]: sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
Jun  1 11:11:32 arm pppd[2118]: rcvd [LCP EchoRep id=0x0 magic=0x96a24aa4]
Jun  1 11:11:32 arm pppd[2118]: rcvd [LCP ProtRej id=0x3 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15]
Jun  1 11:11:32 arm pppd[2118]: Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
Jun  1 11:11:32 arm pppd[2118]: rcvd [IPCP ConfNak id=0x1 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
Jun  1 11:11:32 arm pppd[2118]: sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
Jun  1 11:11:33 arm pppd[2118]: rcvd [IPCP ConfNak id=0x2 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
Jun  1 11:11:33 arm pppd[2118]: sent [IPCP ConfReq id=0x3 <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
Jun  1 11:11:34 arm pppd[2118]: rcvd [IPCP ConfNak id=0x3 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
Jun  1 11:11:34 arm pppd[2118]: sent [IPCP ConfReq id=0x4 <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
Jun  1 11:11:35 arm pppd[2118]: rcvd [IPCP ConfNak id=0x4 <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
Jun  1 11:11:35 arm pppd[2118]: sent [IPCP ConfReq id=0x5 <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns2 10.11.12.14>]
Jun  1 11:11:35 arm pppd[2118]: rcvd [IPCP ConfReq id=0x1]
Jun  1 11:11:35 arm pppd[2118]: sent [IPCP ConfNak id=0x1 <addr 0.0.0.0>]
Jun  1 11:11:35 arm pppd[2118]: rcvd [IPCP ConfNak id=0x5 <addr 100.120.34.72> <ms-dns1 209.91.107.11> <ms-dns2 209.121.225.11>]
Jun  1 11:11:35 arm pppd[2118]: sent [IPCP ConfReq id=0x6 <addr 100.120.34.72> <ms-dns1 209.91.107.11> <ms-dns2 209.121.225.11>]
Jun  1 11:11:35 arm pppd[2118]: rcvd [IPCP ConfReq id=0x2 <addr 100.120.34.72>]
Jun  1 11:11:35 arm pppd[2118]: sent [IPCP ConfAck id=0x2 <addr 100.120.34.72>]
Jun  1 11:11:35 arm pppd[2118]: rcvd [IPCP ConfAck id=0x6 <addr 100.120.34.72> <ms-dns1 209.91.107.11> <ms-dns2 209.121.225.11>]
Jun  1 11:11:36 arm pppd[2118]: not replacing existing default route via 192.168.1.254
Jun  1 11:11:36 arm pppd[2118]: local  IP address 100.120.34.72
Jun  1 11:11:36 arm pppd[2118]: remote IP address 100.120.34.72
Jun  1 11:11:36 arm pppd[2118]: primary   DNS address 209.91.107.11
Jun  1 11:11:36 arm pppd[2118]: secondary DNS address 209.121.225.11
Jun  1 11:11:36 arm pppd[2118]: Script /etc/ppp/ip-up started (pid 2186)
Jun  1 11:11:50 arm pppd[2118]: Script /etc/ppp/ip-up finished (pid 2186), status = 0x0

pppd 对等文件:

debug
#dump
linkname ppp0
#/dev/ttymxc0
/dev/mux0
115200
lock
#crtscts
#modem
nocrtscts
nocdtrcts
noauth
passive
usepeerdns
defaultroute
#noipdefault
ipcp-accept-local
ipcp-accept-remote
refuse-eap
refuse-pap
refuse-chap
refuse-mschap
asyncmap 0
#noccp
persist
holdoff 10
novj
connect '/usr/sbin/chat -vV -f /etc/ppp/chat-HSPA910CF-nopin'

聊天脚本:

TIMEOUT 30
ABORT   '\nBUSY\r'
ABORT   '\nERROR\r'
ABORT   '\nNO ANSWER\r'
ABORT   '\nNO CARRIER\r'
ABORT   '\nNO DAILTONE\r'
ABORT   '\nRING\r\n\r\nRING\r'
''  AT
OK  AT+CGDCONT=1,"IP","sp.telus.com"
TIMEOUT 30
OK  ATD*99***1#
CONNECT ""

连接似乎工作正常,但尝试 ping 或访问任何内容均不起作用。这可能是调制解调器方面的一些设置问题吗?

有什么想法吗?

答案1

解决了

问题与本地和远程 IP 地址相同无关(尽管我仍然认为这很奇怪(?))。问题与 syslog 中的这一行有关:

不通过 192.168.1.254 替换现有的默认路由

暂时我添加了 replacedefaultroute 选项

相关内容