Skip to content

Instantly share code, notes, and snippets.

@gdamjan
Created December 2, 2011 21:37
Show Gist options
  • Save gdamjan/1424938 to your computer and use it in GitHub Desktop.
Save gdamjan/1424938 to your computer and use it in GitHub Desktop.
connect to 3G from command line (with pppd and chat)
# file: /etc/ppp/peers/3g
# usage: pppd call 3g
connect '/etc/ppp/peers/dial -V -Upublicinternet -T*99***1#'
user internet
password internet
noauth
usepeerdns
noipdefault
defaultroute
nodetach
debug
#! /usr/sbin/chat -f
# file: /etc/ppp/peers/dial
# save and make executable -- 'chmod +x /etc/ppp/peers/dial'
# Usage (in pppd config):
# connect '/etc/ppp/peers/dial -V -U<APN> -T<dial number>'
ABORT "BUSY"
ABORT "RING"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
REPORT CONNECT
# initialize
TIMEOUT 10
"" AT
OK ATZ
OK AT+CGDCONT=1,"IP","\U"
# dial
TIMEOUT 40
OK 'ATD\T'
CONNECT \c
@gdamjan
Copy link
Author

gdamjan commented Dec 5, 2011

Make sure your sim card in the 3G modem doesn't require a pin -- alternatively add the pin to the dial file, something like AT+CPIN=1234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment