M
M
Myr4ik2014-07-24 23:39:44
Ping
Myr4ik, 2014-07-24 23:39:44

How to properly configure PPPoE connection and its monitoring in OpenWRT?

To begin with, I will describe the scheme of my connection to the network:
PC> TP-Link 740 router> D-Link DSL-2500U/BRU/D ADSL modem (in bridge mode)> Internet.
I flashed the router (tp-link 740) in openwrt and faced the problem of raising the PPPoE session.
network config:

config interface 'loopback'
  option ifname 'lo'
  option proto 'static'
  option ipaddr '127.0.0.1'
  option netmask '255.0.0.0'

config interface 'lan'
  option ifname 'eth0'
  option type 'bridge'
  option proto 'static'
  option ipaddr '192.168.1.1'
  option netmask '255.255.255.0'

config interface 'wan'
  option _orig_ifname 'eth1'
  option _orig_bridge 'false'
  option ifname 'eth1'
  option proto 'pppoe'
  option username 'username'
  option password 'pass'

config interface 'local'
  option proto 'static'
  option ifname 'eth1'
  option ipaddr '10.0.0.2'
  option netmask '255.255.255.0'

config switch
  option name 'eth0'
  option reset '1'
  option enable_vlan '1'

config switch_vlan
  option device 'eth0'
  option vlan '1'
  option ports '0 1 2 3 4'

The problem is that with such settings, the PPPoE connection was not automatically established (or rather, it was established, but very, very rarely) and I had to do "ifup wan".
I added "ifup wan" to autoload, but this was not enough, because when the connection was broken, the PPPoE connection did not reconnect on its own ...
I googled the Internet and found the following script:
#!/bin/sh
    if ! ping -q -c 1 -W 10 8.8.8.8 > /dev/null; then
        (ifdown wan; sleep 10; ifup wan) &
    fi

I set up cron to run the script every 2 minutes and everything seemed to work out. I got rid of ifup and enjoyed life until I turned on μTorrent (((
The torrent client loads the channel so much that the packets do not reach / from 8.8.8.8 and the script "starts to think" that the connection is lost, after which I changed the value of the "-c" option (from the script) from 1 to 5, but it did not give a positive result.
Please tell me how to make pppd "dial" to the provider until the connection is established and in case the established connection is broken, resume "dialing"
?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Myr4ik, 2014-07-28
@Myr4ik

Problem solved by switching me to another/new DSLAM.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question