linux gprs模块ppp拨号上网

作者:fly 发布于:2015-10-31 21:46

www.forwhat.cn

linux内核自带支持pppd,所以我们在这里配置内核就可以了。


make menuconfig

    Device Drivers->

     ->Network Device Support->
       <*> PPP (point-to-point protocol) support
       [*]   PPP multilink support
       <*> PPP support for async serial ports
       <*> PPP support for sync tty ports
       <*> SLIP (serial line) support

       [*]   CSLIP compressed headers


添加一下3个脚本

1,  /etc/ppp/peers/gprs:


    #/etc/ppp/peers/gprs
    # This is pppd script for China Mobile, used Huawei GTM900-B GPRS Module
    # Usage:   root>pppd call gprs
    /dev/ttyS0
    19200
    crtscts
    modem
    #noauth
    debug
    nodetach
    #hide-password
    usepeerdns
    noipdefault
    defaultroute
    user "cmnet"
    0.0.0.0:0.0.0.0
    #ipcp-accept-local
    #ipcp-accept-remote
    #lcp-echo-failure  12
    #lcp-echo-interval 3
    #noccp
    #novj
    #novjccomp
    #persist
    connect '/usr/sbin/chat -s -v -f /etc/ppp/gprs-connect-chat'
    #connect '/bin/chat -v -s -f /etc/ppp/gprs-connect-chat'
    #disconnect '/bin/chat -v -f /etc/ppp/gprs-disconnect-chat'
2,  gprs-connect-chat:



    #/etc/ppp/gprs-connect-chat
    # chat script for China Mobile, used HuaWei GTM900-B GPRS module.
    TIMEOUT         15
    ABORT           "DELAYED"
    ABORT           "BUSY"
    ABORT           "ERROR"
    ABORT           "NO DIALTONE"
    ABORT           "NO CARRIER"
    TIMEOUT         40
    ''              \rAT
    OK                ATS0=0
    OK              ATE0V1
    OK              AT+CGDCONT=1,"IP","CMNET"
    OK              ATDT*99***1#
    CONNECT         ''
3, 用于chap认证的密码文件:chap-secrets,由于移动的GPRS服务不需要用户名和密码,所以刚开始没设用户名和密码,结果在chap认证的时候总不能通过.后来在gprs里添加user "cmnet"和这个密码文件后就OK了.



    #/etc/ppp/chap-secrets
    #client    server secret IP address
    "cmnet"    *     "cmnet"    * 
随后执行pppd call gprs


发表评论:

 
Powered by emlog sitemap