Linux&android PPP Related knowledge

Source: Internet
Author: User
Tags get ip nameserver

Linux&android PPP Related FAQs

Catalogue

Linux&android PPP-Related FAQs: 1

I. Document DESCRIPTION ... 3

Second, the Common debugging technology ... 4

1. View PPP log information ... 4

2. View the dial-up IP. 4

3. View routes, configure Routes ... 4

4. Ping IP and URLs ... 4

5. Set up DNS. 5

Third, the problem record ... 6

1. Linux number failed ... 6

2. Unable to build data business under Android ... 6

3. Linux and Android have IP can ping the address cannot ping domain name ... 6

4. Linux and Android have IP can ping the domain name and address ... 7

5. Customer multi-network card can not be online ... 7

Appendix A: Dual-NIC routing configuration cases ... 8

First, the document description

This document is primarily a record of PPP-related error points and typical customer support records under Linux.

Customers who use PPP for data Services under Linux and Android generally encounter the following types of problems:

1) Linux number failed

2) Unable to build data business under Android

3) Linux and Android have IP can ping address cannot ping domain name

4) IP can ping domain name and address under Linux and Android

5) Customers with multiple network cards cannot surf the internet

Second, the common debugging technology 1. View PPP log information

1) under Linux:

Tail-f/var/log/syslog

Or

Tail-f/var/log/messages

2) under Android:

Logcat-s PPPD

2. View dial-up IP

1) under Linux:

Ifconfig

2) under Android:

Netcfg

3. View routes, configure routes

1) View routes:

Route

2) Configure routing:

Route add

3) Examples:

Route add-net 192.56.76.0 netmask 255.255.255.0 Dev eth0

Add a route to "eth0" that points to network 192.56.76.x. The Class C subnet mask is not required because 192.* is a class C IP address. This keyword "dev" can be omitted.

Route add default GW MANGO-GW

Add a default route (use it if you cannot match other routes). All groupings that use this route will be transferred through the gateway "MANGO-GW".

4. Ping IP and URLs

1) Ping IP address:

Ping 8.8.8.8

2) Ping domain:

Ping www.baidu.com

5. Set up DNS

1) directly modify the configuration file:

/etc/resolv.conf

2) Examples:

/SYSTEM/ETC/PPP # vi/etc/resolv.conf

NameServer 8.8.8.8

NameServer 8.8.4.4

Iii. issue record 1. Linux number failed

Problem

Linux downgrade PPPD call QUECTEL-PPP return failure

Phenomenon 1

Tip: Connect script failed

Analysis

Script connection error, possibly a script format issue.

Workaround

Execute under Linux: Dos2unix script file name

Phenomenon 2

Dial log appears, but cannot get IP

Analysis

Check if the card is not paid, whether there is no card, whether the antenna is not connected or the signal is too weak

Workaround

For the above analysis and troubleshooting

2. Unable to build data business under Android

Problem

Linux downgrade PPPD call QUECTEL-PPP return failure

Phenomenon 1

Dial PPP Log display error

Analysis

APN Error (Domestic public network card APN arbitrarily set, wrong can but not no, the special network card requires a dedicated APN, not fill the wrong; foreign needs to write the correct APN according to the operator's requirements)

Workaround

Add the correct APN

Phenomenon 2

Dial-up log appears, but dial has failed to get IP

Analysis

Check if the card is not paid, whether there is no card, whether the antenna is not connected or the signal is too weak

Workaround

For the above analysis and troubleshooting

Phenomenon 3

No dialing information from Logcat, or a lot of error in Ril information

Analysis

Ril may be restarted due to an error, check if Ril is actually restarted

Workaround

Submit restart log, research and development analysis

Phenomenon 4

Android phone texting and other functions OK, but unable to get IP

Analysis

Check whether the data business switch is on, whether APN is set, check whether the data service is set correctly in Init.rc

Workaround

The data service may not be opened, the data service needs to be opened, the APN is not set up to fill in the correct APN; add correct service

Phenomenon 5

Telephone, SMS, signal display, data services are not normal use

Analysis

Check if RIL is properly integrated

Workaround

Re-integration if not correct

3. Linux and Android have IP can ping address cannot ping domain name

Problem

With Ifconfig you can see that the PPP0 has IP, and can ping the URL but not ping the domain name

Phenomenon 1

With Ifconfig you can see that the PPP0 has IP, and can ping the URL but not ping the domain name

Analysis

This situation is DNS is not set or DNS settings are problematic, you can check the/etc/resolv.conf confirmation

Workaround

Modify/etc/resolv.conf Add DNS retry.

Under normal circumstances should have been set successfully, the Linux distribution version of the ip-up will be configured dns,android ip-up we did the processing will also set up DNS.

4. Linux and Android IP can ping the domain name and address

Problem

Through Ifconfig can see ppp0 have IP, but can't ping url also can't ping domain name

Phenomenon 1

Through Ifconfig can see ppp0 have IP, but can't ping url also can't ping domain name

Analysis

This situation is most likely a problem with routing settings. You need to use the route to check if the route exists and is correct

Workaround

If there is no routing information there must be a problem; if there is routing information, but there is no default route, it should be wrong, because our script adds ppp0 to the default route.

5. Customers with multiple network cards cannot surf the internet

Problem

Customer device using multiple network cards, using wireless module online failure situation

Phenomenon 1

Customer device using multiple network cards, using wireless module online failure situation

Analysis

Because multiple network cards exist at the same time, there may be a problem with routing settings, which causes the data to go out when the routing configuration is wrong.

Workaround

Reference Appendix A

6. PPP dial disconnect, do not report no CARRIER

Problem

Disconnect PPP, do not report no CARRIER

Phenomenon 1

When the customer negotiates the authentication mode in LCP phase, the module requests PAP, and after being rejected by the MCU, the module sends the terminating frame. However, in the PPP process, no carrier is seen to escalate, and the module does exit the PPP state. If the customer opens the Echo, there is a loopback error.

Analysis

Monitoring module TX, confirm that the module is reported no CARRIER.

With the customer's script test survey, the client's script will indeed continue to send requests to the module after the terminate.

Workaround

Change the NOLOCK option in the customer's script to lock and Add modem option (modem option should be pppd default option, can not add, add more insurance)

Appendix A: Dual-NIC Routing configuration case

1, my machine wired network card is ETH0,PPP dial generation ppp0, information as follows:

[Email protected]:~# ifconfig

eth0 Link ENCAP: Ethernet Hardware Address d4:be:d9:9a:01:5d

inet Address: 192.168.10.46 Broadcast: 192.168.10.255 Mask: 255.255.255.0

Inet6 Address: fe80::d 6be:d9ff:fe9a:15d/64scope:link

Up broadcast RUNNING multicast mtu:1500 hop count: 1

Receive packet: 897703 error: 10 Discard: 0 Overload: 0 Number of frames: 5

Send packet: 42177 error: 0 Discard: 0 Overload: 0 Carrier: 0

Collisions: 0 Send Queue Length: 1000

Receive bytes: 84285024 (84.2 MB) Send bytes: 20817523 (20.8 MB)

Interruption: memory:e1a00000-e1a20000

Ppp0 Link EnCap: Point-to-Point protocol

inet Address: 10.4.24.116 Point-to-point: 10.64.64.64 Mask: 255.255.255.255

Up Pointopoint RUNNING noarp multicast mtu:1500 hop count: 1

Receive packet: 5 error: 0 Discard: 0 Overload: 0 Number of frames: 0

Send packet: 4 error: 0 Discard: 0 Overload: 0 Carrier: 0

Collisions: 0 Send Queue Length: 3

Bytes Received: (55.0 B) Send bytes: $ (58.0 b)

2, the routing configuration requirements are as follows:

192.168.10.0 network segment (ie my local area network) data go eth0, access outside the network go ppp0.

3. Configuration operation

1) before modification

[Email protected]:~# Route

Kernel IP routing Table

Destination Gateway Subnet Mask flag hop reference using interface

Default 192.168.10.1 0.0.0.0 UG 0 0 0 eth0

10.64.64.64 * 255.255.255.255 UH 0 0 0 ppp0

192.168.10.0 * 255.255.255.0 U 0 0 0 eth0

2) Delete the default route

Because the default route is to go eth0, the external network to go ppp0, so the route is not correct, so delete.

[Email protected]:~# Route del Default

[Email protected]:~# Route

Kernel IP routing Table

Destination Gateway Subnet Mask flag hop reference using interface

10.64.64.64 * 255.255.255.255 UH 0 0 0 ppp0

192.168.10.0 * 255.255.255.0 U 0 0 0 eth0

[Email protected]:~# Ping www.baidu.com

Ping:unknown Host Www.baidu.com

[Email protected]:~# Ping 8.8.8.8

Connect:network is unreachable

3) Add default route, let extranet data go ppp0

[Email protected]:~# route add default gw10.4.24.116

[Email protected] plex-790:~# Route

Kernel IP routing Table

Destination Gateway Subnet Mask flag hop reference using interface

Default 10.4.24.116 0.0.0.0 UG 0 0 0 ppp0

10.64.64.64 * 255.255.255.255 UH 0 0 0 ppp0

192.168.10.0 * 255.255.255.0 U 0 0 0 eth0

[Email protected]:~# Ping 8.8.8.8

PING 8.8.8.8 (8.8.8.8) bytes of data.

Bytes from 8.8.8.8:icmp_req=1 ttl=36time=405 ms

Bytes from 8.8.8.8:icmp_req=2 ttl=36time=434 ms

^c

---8.8.8.8 ping statistics---

2 packets transmitted, 2 received, 0% Packetloss, Time 1001ms

RTT Min/avg/max/mdev =405.474/419.767/434.060/14.293 ms

5) Add route to let LAN data go eth0

The following information is already visible from the route:

192.168.10.0 * 255.255.255.0 U 0 0 0 eth0

The route is to take the 192.168.10.0 segment data eth0, so this route does not need to be added, and if the route does not exist, it can be added using the following command:

Route add-net 192.168.10.0 netmask255.255.255.0 GW 192.168.10.46 Dev eth0

Linux&android PPP Related knowledge

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.