Using wvdial in linux to implement gprs dial-up Internet access

Source: Internet
Author: User

1. Install wvdial

Sudo apt-get install wvdial

2. Write the configuration information of wvdial in/etc/wvdial. conf: femacs/etc/wvdial. conf.

Init1 = ATZ

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

Init3 = AT + CGDCONT = 1, "IP", "CMNET" # important! Otherwise, DNS cannot be used.

Modem Type = Analog Modem

Baud = 115200 # Set Based on your gprs modem

New PPPD = yes

Modem =/dev/ttyS0 # Your connected serial port

ISDN = 0

Phone = * 99 *** 1 ### China Mobile's dial-up number

Password = *** # It is useless.

Username = itlanger

In this step, you can run wvdial first, then the modem cannot be found, and then modify/etc/wvdial. conf to add

Baud = 115200 # Set Based on your gprs modem

Modem =/dev/ttyS0 # Your connected serial port

Run wvdial again, and then manually add the content to/etc/wvdial. conf:

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

Phone = * 99 *** 1 ### China Mobile's dial-up number

Password = *** # It is useless.

Username = itlanger

Here Init3 = AT + CGDCONT = 1, "IP", "CMNET" must be added, otherwise wvdial will appear:

Warning, can't find address for 'www .suse.de'

--> Warning, address lookup does not work

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

As a result, only IP addresses can be pinged and domain names cannot be pinged.

3. Configure the ppp parameter: femacs/etc/ppp/options

Noipdefault

Ipcp-accept-local

Ipcp-accept-remote

Defaultroute

Noauth

Crtscts

Debug

4. dial-up Internet access: 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 #}% <e ~

--> Carrier detected. Waiting for prompt.

~ [7f] }#@!} #}} 9} "}&}}}}}'}"} (} "}%}& K _ {}# }#}% B #}% <e ~

--> 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. Disconnect the Ethernet:

Sudo ifconfig eth0 down

Sudo route add default gw 10.24.229.233 # Here is the IP address of ppp0

5. Test network:

Ping 60.28.166.84

Ping www.chinaunix.net

If the domain name cannot be pinged, You Can cat/etc/resolv. conf

Then write the DNS obtained by dialing
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.