IT貓撲網(wǎng):您身邊最放心的安全下載站! 最新更新|軟件分類|軟件專題|手機(jī)版|論壇轉(zhuǎn)貼|軟件發(fā)布

您當(dāng)前所在位置: 首頁操作系統(tǒng)LINUX → linux下用wvdial實(shí)現(xiàn)gprs撥號(hào)上網(wǎng)

linux下用wvdial實(shí)現(xiàn)gprs撥號(hào)上網(wǎng)

時(shí)間:2015-06-28 00:00:00 來源:IT貓撲網(wǎng) 作者:網(wǎng)管聯(lián)盟 我要評(píng)論(0)

  1. 安裝wvdial

  sudo apt-get install wvdial

  2. 在/etc/wvdial.conf中寫入wvdial的配置信息: femacs /etc/wvdial.conf

  Init1 = ATZ

  Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

  Init3 = AT+CGDCONT=1,"IP","CMNET"? ##important! 否則無法使用DNS

  Modem Type = Analog Modem

  Baud = 115200? ##根據(jù)你的gprs modem來設(shè)定

  New PPPD = yes

  Modem = /dev/ttyS0 ##你所連接的串口

  ISDN = 0

  Phone = *99***1#? ##中國移動(dòng)的撥號(hào)號(hào)碼

  Password = ***??? ##其實(shí)沒什么用

  Username = itlanger

  這一步,可以首先運(yùn)行wvdial,這時(shí)會(huì)出現(xiàn)找不到modem,然后修改/etc/wvdial.conf, 增加

  Baud = 115200? ##根據(jù)你的gprs modem來設(shè)定

  Modem = /dev/ttyS0 ##你所連接的串口

  然后再次運(yùn)行wvdial, 再手動(dòng)加入一下內(nèi)容到/etc/wvdial.conf:

  Init3 = AT+CGDCONT=1,"IP","CMNET"

  Phone = *99***1#? ##中國移動(dòng)的撥號(hào)號(hào)碼

  Password = ***??? ##其實(shí)沒什么用

  Username = itlanger

  這里Init3 = AT+CGDCONT=1,"IP","CMNET" 一定要加,否則wvdial撥號(hào)時(shí)會(huì)出現(xiàn):

  warning, can't find address for `www.suse.de`

  --> warning, address lookup does not work

  --> Nameserver (DNS) failure, the connection may not work.

  導(dǎo)致只能ping通IP,不能ping通域名

  3. 配置ppp參數(shù): femacs /etc/ppp/options

  noipdefault

  ipcp-accept-local

  ipcp-accept-remote

  defaultroute

  noauth

  crtscts

  debug

#p#副標(biāo)題#e#

  4.撥號(hào)上網(wǎng): sudo wvdial

  --> WvDial: Internet dialer version 1.60

  --> Initializing modem.

  --> Sending: ATZ

  ATZ

  OK

  --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

  ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0

  OK

  --> Sending: AT+CGDCONT=1,"IP","CMNET"

  AT+CGDCONT=1,"IP","CMNET"

  OK

  --> Modem initialized.

  --> Sending: ATDT*99***1#

  --> Waiting for carrier.

  ATDT*99***1#

  CONNECT

  ~[7f]}#@!}!}#} }9}"}&} }*} } }'}"}(}"}%}&K_{}$}#}%B#}%

  --> Carrier detected.? Waiting for prompt.

  ~[7f]}#@!}!}#} }9}"}&} }*} } }'}"}(}"}%}&K_{}$}#}%B#}%

  --> PPP negotiation detected.

  --> Starting pppd at Tue Dec 15 11:19:14 2009

  --> Pid of pppd: 6666

  --> Using interface ppp0

  --> Authentication (CHAP) started

  --> Authentication (CHAP) successful

  --> local? IP address 10.24.229.233

  --> remote IP address 192.168.254.254

  --> primary?? DNS address 211.137.160.5

  --> secondary DNS address 211.136.17.107

  --> Script /etc/ppp/ip-up run successful

  --> Default route Ok.

  --> Nameserver (DNS) Ok.

  --> Connected... Press Ctrl-C to disconnect

  4. 斷開以太網(wǎng)連接:

  sudo ifconfig eth0 down

  sudo route add default gw 10.24.229.233 ##這里是ppp0的IP

  5. 測(cè)試網(wǎng)絡(luò):

  ping 60.28.166.84

  ping www.chinaunix.net

  如果ping不通域名,可以cat /etc/resolv.conf

  然后寫入撥號(hào)獲得的DNS

關(guān)鍵詞標(biāo)簽:linux,wvdial,gprs,撥

相關(guān)閱讀

文章評(píng)論
發(fā)表評(píng)論

熱門文章 安裝紅帽子RedHat Linux9.0操作系統(tǒng)教程 安裝紅帽子RedHat Linux9.0操作系統(tǒng)教程 Tomcat9.0如何安裝_Tomcat9.0環(huán)境變量配置方法 Tomcat9.0如何安裝_Tomcat9.0環(huán)境變量配置方法 多種操作系統(tǒng)NTP客戶端配置 多種操作系統(tǒng)NTP客戶端配置 Linux操作系統(tǒng)修改IP Linux操作系統(tǒng)修改IP

相關(guān)下載

    人氣排行 Linux下獲取CPUID、硬盤序列號(hào)與MAC地址 dmidecode命令查看內(nèi)存型號(hào) linux tc實(shí)現(xiàn)ip流量限制 安裝紅帽子RedHat Linux9.0操作系統(tǒng)教程 linux下解壓rar文件 lcx.exe、nc.exe、sc.exe入侵中的使用方法 Ubuntu linux 關(guān)機(jī)、重啟、注銷 命令 查看linux服務(wù)器硬盤IO讀寫負(fù)載