我参考了 3-4 个关于使用 GSM 调制解调器设置 PPP 连接的教程。我有一个 Linux 操作系统 - 我将在 Mint 和 Debian 上使用它。
https://www.rhydolabz.com/wiki/?p=16325#comment-50134 https://raspberrypi.stackexchange.com/questions/44597/how-to-use-internet-using-pppd-and-sim800-gsm-addon
我可以配置聊天脚本,并且ppp0
界面在运行时显示ifconfig
。
但互联网不工作。
我使用这个来/etc/networks/interfaces
在启动时启动 ppp:
...
...
auto rnet
iface rnet inet ppp
provider rnet
...
提示syslog
连接成功:
Oct 22 17:45:33 mrid-VirtualBox pppd[808]: pppd 2.4.7 started by root, uid 0
Oct 22 17:45:35 mrid-VirtualBox pppd[808]: Serial connection established.
Oct 22 17:45:35 mrid-VirtualBox pppd[808]: Using interface ppp0
Oct 22 17:45:35 mrid-VirtualBox pppd[808]: Connect: ppp0 <--> /dev/ttyS0
Oct 22 17:45:36 mrid-VirtualBox pppd[808]: PAP authentication succeeded
Oct 22 17:45:38 mrid-VirtualBox pppd[808]: not replacing default route to enp0s3 [10.0.2.2]
Oct 22 17:45:38 mrid-VirtualBox pppd[808]: local IP address XX.XX.XX.XY
Oct 22 17:45:38 mrid-VirtualBox pppd[808]: remote IP address 192.168.254.254
Oct 22 17:45:38 mrid-VirtualBox pppd[808]: primary DNS address XX.XX.XX.XX
Oct 22 17:45:38 mrid-VirtualBox pppd[808]: secondary DNS address XX.XX.XX.YY
并ifconfig
给出以下响应:
...
...
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet XX.XX.XX.XX netmask 255.255.255.255 destination 192.168.254.254
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 4 bytes 64 (64.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5 bytes 97 (97.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
但是互联网无法使用。我已使用 AT 命令检查了 GET 请求,确认 SIM 可以访问互联网。
可能是什么问题??
编辑#1
这是命令的结果route
:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
default _gateway 0.0.0.0 UG 20100 0 0 enp0s3
default _gateway 0.0.0.0 UG 20101 0 0 enp0s8
10.0.2.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
link-local 0.0.0.0 255.255.0.0 U 1000 0 0 enp0s3
192.168.0.0 0.0.0.0 255.255.255.0 U 101 0 0 enp0s8
192.168.254.254 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0