# Pppd connection loss then reconnect

**URL:** <https://linux-tips.com/t/pppd-connection-loss-then-reconnect/319>\
**Category:** Network\
**Created:** [January 28, 2016, 8:46am UTC](https://linux-tips.com/t/pppd-connection-loss-then-reconnect/319 "2016-01-28T08:46:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![saucompeng](https://linux-tips.com/user_avatar/linux-tips.com/saucompeng/32/176_2.png) [@saucompeng](https://linux-tips.com/u/saucompeng)\
**Post date:** [January 28, 2016, 8:46am UTC](https://linux-tips.com/t/pppd-connection-loss-then-reconnect/319/1 "2016-01-28T08:46:23Z")

</div>

Hi;

I make pppd connection with configurations which are at the bottom. But many times later, my connection loses then can’t reconnect to internet. What is the stable configuration for pppd?

```
ttyACM0 460800
user internet
password internet
connect 'chat -f /etc/ppp/chat/gprs_chat -e'
novj
asyncmap 0
defaultroute
usepeerdns
debug
kdebug 7
nodetach
noipdefault
lock
modem
lcp-echo-interval 0
lcp-echo-failure 4
lcp-max-configure 60
lcp-restart 2
idle 600
noipx
logfile /home/logppp.txt
```

---

<div class="post-metadata">

**Author:** ![demirten](https://linux-tips.com/user_avatar/linux-tips.com/demirten/32/64_2.png) [@demirten](https://linux-tips.com/u/demirten)\
**Post date:** [January 28, 2016, 4:27pm UTC](https://linux-tips.com/t/pppd-connection-loss-then-reconnect/319/2 "2016-01-28T16:27:42Z")

</div>

Could you send pppd logfile output?

---

<div class="post-metadata">

**Author:** ![saucompeng](https://linux-tips.com/user_avatar/linux-tips.com/saucompeng/32/176_2.png) [@saucompeng](https://linux-tips.com/u/saucompeng)\
**Post date:** [January 29, 2016, 5:29am UTC](https://linux-tips.com/t/pppd-connection-loss-then-reconnect/319/3 "2016-01-29T05:29:01Z")

</div>

logfile and pppd always on script : [https://drive.google.com/folderview?id=0B3FMvhilYdQFWjFHWnZXMG9uMms&usp=sharing](https://drive.google.com/folderview?id=0B3FMvhilYdQFWjFHWnZXMG9uMms&usp=sharing)

---

<div class="post-metadata">

**Author:** ![demirten](https://linux-tips.com/user_avatar/linux-tips.com/demirten/32/64_2.png) [@demirten](https://linux-tips.com/u/demirten)\
**Post date:** [January 29, 2016, 10:42am UTC](https://linux-tips.com/t/pppd-connection-loss-then-reconnect/319/4 "2016-01-29T10:42:20Z")

</div>

There is no exact hint about the problem in the log file.

You can check LCP configuration options starts with **lcp-** (see: [man pppd](http://manpages.org/pppd/8#options))

If you set `lcp-echo-interval` to 30 seconds and LCP-Echo requests failed at number of `lcp-echo-failure`, pppd will exit.

It is not clear that how pppd behaves when `lcp-echo-interval = 0` like your setup. So, it is good to use a reasonable value here.

You also have `idle = 600` parameter, so if no IP packets seen by pppd for last 600 seconds, it will be stopped.

---

<div class="post-metadata">

**Author:** ![saucompeng](https://linux-tips.com/user_avatar/linux-tips.com/saucompeng/32/176_2.png) [@saucompeng](https://linux-tips.com/u/saucompeng)\
**Post date:** [January 31, 2016, 12:42pm UTC](https://linux-tips.com/t/pppd-connection-loss-then-reconnect/319/5 "2016-01-31T12:42:17Z")

</div>

My client is connecting to webservice every minute. This configuration is good for me ?

ttyACM0 460800  
user internet  
password internet  
connect 'chat -f /etc/ppp/chat/gprs\_chat -e’  
novj  
asyncmap 0  
defaultroute  
usepeerdns  
debug  
kdebug 7  
nodetach  
noipdefault  
modem  
lcp-echo-interval 10  
lcp-echo-failure 12  
lcp-max-configure 60  
lcp-restart 120  
idle 600  
noipx  
logfile /home/logppp.txt

---

<div class="post-metadata">

**Author:** ![demirten](https://linux-tips.com/user_avatar/linux-tips.com/demirten/32/64_2.png) [@demirten](https://linux-tips.com/u/demirten)\
**Post date:** [January 31, 2016, 2:33pm UTC](https://linux-tips.com/t/pppd-connection-loss-then-reconnect/319/6 "2016-01-31T14:33:44Z")

</div>

You’re sending IP data on every 60 seconds. It will be good to detect GPRS session lost errors, so you can use

```auto
lcp-echo-interval 30
lcp-echo-failure 2

```

With above configuration, pppd will be terminated if it can’t get any replies for two consecutive LCP Echo Request.

---

<div class="post-metadata">

**Author:** ![saucompeng](https://linux-tips.com/user_avatar/linux-tips.com/saucompeng/32/176_2.png) [@saucompeng](https://linux-tips.com/u/saucompeng)\
**Post date:** [February 1, 2016, 5:17pm UTC](https://linux-tips.com/t/pppd-connection-loss-then-reconnect/319/7 "2016-02-01T17:17:36Z")

</div>

Hi;

I found problem, it is about usb driver. When repower modem, it works normallya again. Logs are at link. Could you analyse it ?

[https://drive.google.com/folderview?id=0B3FMvhilYdQFYVgtcnRGNUIzZG8&usp=sharing](https://drive.google.com/folderview?id=0B3FMvhilYdQFYVgtcnRGNUIzZG8&usp=sharing)

is it about this parameter?

```
dwc_otg.speed=1 //forces usb full-speed (12 Mbit/s), otherwise the usb is running at hi-speed (480 Mbit/s).
```

---

<div class="post-metadata">

**Author:** ![demirten](https://linux-tips.com/user_avatar/linux-tips.com/demirten/32/64_2.png) [@demirten](https://linux-tips.com/u/demirten)\
**Post date:** [February 1, 2016, 8:18pm UTC](https://linux-tips.com/t/pppd-connection-loss-then-reconnect/319/8 "2016-02-01T20:18:36Z")

</div>

It is not easy to find root cause of the problem.

All of the USB 3G modems I used has very buggy drivers. None of them designed for 7x24 non-interactive work, it basically targets desktop user who can un-plug and plug the device again if it doesn’t work.

It is also possible to have usb problems in your embedded board but I can easily say that main problem is the 3G usb modem itself according to my previous experience.

So, good luck 😄

---

<div class="post-metadata">

**Author:** ![saucompeng](https://linux-tips.com/user_avatar/linux-tips.com/saucompeng/32/176_2.png) [@saucompeng](https://linux-tips.com/u/saucompeng)\
**Post date:** [February 2, 2016, 12:18am UTC](https://linux-tips.com/t/pppd-connection-loss-then-reconnect/319/9 "2016-02-02T00:18:31Z")

</div>

😕 I want to cry , insaallah I will find solution, If I find, I will share it. Thanks for your help.
