/etc/ppp/peers/gprs
/dev/ttyACM0
460800
connect "/usr/sbin/chat -v -f /etc/ppp/gprs-script"
noath
defaultroute
nodetach
user beeline
:10.0.0.1
/etc/ppp/gprs-script
TIMEOUT 5
ECHO ON
ABORT '\nBUSY\r'
ABORT '\nERROR\r'
ABORT '\nNOANSWER\r'
ABORT '\nNO CARRIER\r'
ABORT '\nNO DIALTONE\r'
ABORT '\nRINGING\r\n\r\nRINGING\r'
'' \rAT
TIMEOUT 12
OK ATH
OK ATE1
OK AT+CGDCONT=1, "IP", "internet.beeline.ru"
OK ATDT*99***1#
CONNECT
bash$ sudo pppd call gprs
...
PAP authentication succeeded
local IP address 10.200.57.153
remote IP address 10.0.0.1
и все, на этом дело заканчивается, пинги никуда не идут
polachok:~% sudo cat /etc/ppp/peers/beeline
[sudo] password for polachok:
/dev/ttyACM0 # My rfcomm thing to the phone.
persist
name beeline
user beeline
noauth
refuse-chap
connect '/usr/sbin/chat -v -f /etc/ppp/beeline-connect'
disconnect '/usr/sbin/chat -v -f /etc/ppp/beeline-disconnect'
usepeerdns
defaultroute # Setup gateway stuff when connected.
#noipdefault # Don't think it matters, it will negotiate an IP anyways. It just defaults to ask the server for IP with this set. Some links won't work if you don't set it!
#auth
115200 # Connection speed. Maybe this should be something else.
#230400
crtscts
polachok:~% sudo cat /etc/ppp/beeline-connect
TIMEOUT 20
ABORT '\nBUSY\r'
ABORT '\nERROR\r'
ABORT '\nNO ANSWER\r'
ABORT '\nNO CARRIER\r'
ABORT '\nNO DIALTONE\r'
'' AT
OK ATE1
OK 'AT+CGDCONT=1,"IP","internet.beeline.ru"'
OK ATDT*99***1#
TIMEOUT 40
CONNECT
polachok:~% route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.100.101 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ppp0
у меня лог такой:
Aug 11 17:21:48 pinnsvin chat[23759]: ATE1^M^M
Aug 11 17:21:48 pinnsvin chat[23759]: OK
Aug 11 17:21:48 pinnsvin chat[23759]: -- got it
Aug 11 17:21:48 pinnsvin chat[23759]: send (AT+CGDCONT=1,"IP","internet.beeline.ru"^M)
Aug 11 17:21:49 pinnsvin chat[23759]: expect (OK)
Aug 11 17:21:49 pinnsvin chat[23759]: ^M
Aug 11 17:21:49 pinnsvin chat[23759]: AT+CGDCONT=1,"IP","internet.beeline.ru"^M^M
Aug 11 17:21:49 pinnsvin chat[23759]: OK
Aug 11 17:21:49 pinnsvin chat[23759]: -- got it
Aug 11 17:21:49 pinnsvin chat[23759]: send (ATDT*99***1#^M)
Aug 11 17:21:49 pinnsvin chat[23759]: timeout set to 40 seconds
Aug 11 17:21:49 pinnsvin chat[23759]: expect (CONNECT)
Aug 11 17:21:49 pinnsvin chat[23759]: ^M
Aug 11 17:21:49 pinnsvin chat[23759]: ATDT*99***1#^M^M
Aug 11 17:21:49 pinnsvin chat[23759]: CONNECT
Aug 11 17:21:49 pinnsvin chat[23759]: -- got it
Aug 11 17:21:49 pinnsvin pppd[23758]: Serial connection established.
Aug 11 17:21:49 pinnsvin pppd[23758]: Using interface ppp0
Aug 11 17:21:49 pinnsvin pppd[23758]: Connect: ppp0 <--> /dev/ttyACM0
Aug 11 17:21:50 pinnsvin pppd[23758]: PAP authentication succeeded
Aug 11 17:21:53 pinnsvin pppd[23758]: local IP address 172.19.17.215
Aug 11 17:21:53 pinnsvin pppd[23758]: remote IP address 192.168.100.101
Aug 11 17:21:53 pinnsvin pppd[23758]: primary DNS address 217.118.66.243
Aug 11 17:21:53 pinnsvin pppd[23758]: secondary DNS address 217.118.66.244