使用 3G USB 调制解调器连接到互联网

使用 3G USB 调制解调器连接到互联网

我正在尝试使用 建立互联网连接wvdial。一切正常,但问题是我无法 ping 通google.ca其 IP 地址。

以下是该命令的输出wvdial

WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Sending: AT+CGDCONT=1,"IP","internet.com,wapuser1,wap"
AT+CGDCONT=1,"IP","internet.com,wapuser1,wap"
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT 21096000
--> Carrier detected.  Starting PPP immediately.
--> Starting pppd at Sat Jan  1 05:11:06 2000
--> Pid of pppd: 3297
--> Using interface ppp0
--> pppd: ([07][08]@[07][08][08][07][08]
--> pppd: ([07][08]@[07][08][08][07][08]
--> pppd: ([07][08]@[07][08][08][07][08]
--> pppd: ([07][08]@[07][08][08][07][08]
--> local  IP address 172.19.154.90
--> pppd: ([07][08]@[07][08][08][07][08]
--> remote IP address 10.0.0.1
--> pppd: ([07][08]@[07][08][08][07][08]
--> primary   DNS address 64.71.255.198
--> pppd: ([07][08]@[07][08][08][07][08]
--> secondary DNS address 64.71.255.253
--> pppd: ([07][08]@[07][08][08][07][08]

正如你所见,我可以清楚地获得一个IP,并且输入ifconfig ppp0显示如下内容:

ppp0      Link encap:Point-to-Point Protocol
          inet addr:172.19.27.135  P-t-P:10.0.0.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:74 (74.0 B)  TX bytes:107 (107.0 B)

但无法 ping 任何东西。

所以我知道这不是的问题/etc/resolv.conf

以下是我的内容wvdial.conf

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init3 = AT+CGDCONT=1,"IP","internet.com,wapuser1,wap"
Modem Type = USB Modem
ISDN = 0
New PPPD = yes
Phone = *99#
Modem = /dev/ttyACM0
Username = wapuser1
Password = wap
Baud = 460800
Stupid Mode = 1

我怎样才能使这个设置正常工作?

ip addr show

9: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 3
link/ppp inet 172.16.29.33 peer 10.0.0.1/32 scope global ppp0

ip route show

default dev ppp0 scope link 10.0.0.1 dev ppp0 proto kernel scope link src 172.16.61.19

答案1

我昨天也遇到了同样的问题。今天解决了。查看这个问题的答案。

https://raspberrypi.stackexchange.com/questions/62417/connected-to-internet-on-ppp0-in-raspberry-pi-3-but-commands-like-ping-curl-not

您需要检查是否能够通过 ppp0 接口连接到互联网。输入以下命令并检查输出ping -I ppp0 google.com。如​​果您能够 ping 通,则您的设备已连接到互联网。

然后,您可以运行命令sudo route add default dev ppp0来访问互联网。

相关内容