/etc/ppp/gprs-options:
defaultroute nodetach # Comment out to run in the background mtu 1400 crtscts noipdefault ipcp-accept-local ipcp-accept-remote novj novjccomp debug # Comment out for no debugging info lock replacedefaultroute # update routing table information usepeerdns # find out and update the nameservers
(You do not need this file if you dont have a GPRS username and password /etc/ppp/pap-secrets:
* * "Your-GPRS-Password" *
/etc/ppp/peers/gprs:
name Your-GPRS-Username # If you dont have a username and password, comment this out #noauth # If you commented out the line above, uncomment this /dev/ttyS1 115200 # Serial port line speed and options asyncmap 20A0000 escape FF # Generic GPRS options file /etc/ppp/gprs-options # Chat scripts connect "/usr/sbin/chat -f /etc/ppp/chatscripts/gprs-connect-chat" disconnect "/usr/sbin/chat -f /etc/ppp/chatscripts/gprs-disconnect-chat"
/etc/ppp/chatscripts/gprs-connect-chat:
# Boilerplate
#
ABORT 'BUSY'
ABORT 'NO ANSWER'
ABORT 'NO CARRIER'
ABORT 'NO DIALTONE'
ABORT '\nRINGING\r\n\r\nRINGING\r'
SAY "GPRS modem init: press <ctrl>-C to disconnect"
# Wake up the modem
#
TIMEOUT 5
'' 'AT'
OK-ATQ0V1&C1-OK 'ATE1'
ABORT 'ERROR'
TIMEOUT 12
# Reset to the factory defaults
# Also, use '+CME ERROR' codes for ME errors, 'ERROR' for syntax errors
#
OK 'AT&F'
OK 'AT+CGDCONT=1,"IP","Your-GPRS-APN","0.0.0.0",0,0'
SAY "\n + defining PDP context"
# Attach to the GPRS service. Strictly, we don't need this step,
# as AT+CGDATA will do it for us, but doing it explicitly makes it
# a little easier to debug.
#
TIMEOUT 45
OK 'AT+CGATT=1'
SAY "\n + attaching to GPRS"
# Enter data state
OK 'ATD*99#'
SAY "\n + requesting data connection"
CONNECT ''
SAY "\n + connected"
/etc/ppp/chatscripts/gprs-disconnect-chat:
# Boilerplate
#
ABORT BUSY
ABORT ERROR
ABORT 'NO DIALTONE'
TIMEOUT 30
# Get some attention
'' '+++\c'
SAY " + sending break"
To connect, run following command: "/usr/sbin/pppd call gprs"
For some strange reason, it doesnt add the default route properly. To do this, do a "ifconfig ppp0"
Your output should be something like this:
ppp0 Link encap:Point-Point Protocol
inet addr:172.24.47.195 P-t-P:196.11.57.194 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1400 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:70 (70.0 B) TX bytes:45 (45.0 B)
Now take the P-t-P IP (In my case 196.11.57.194) and type as a root user: /sbin/route add default gw 196.11.57.194 (Replacing 196.11.57.194 with your P-t-P IP)
Now, all you need to do, is put "nameserver <ip of your ISP's nameserver>" in /etc/resolv.conf, and GPRS is fully working!