Results 1 to 4 of 4

Thread: Automatically Change PPPoe Connection

  1. #1

    Automatically Change PPPoe Connection

    I want my router to use a diffrent username & pass between 3-7 am or simply switch WAN Interfaces.

    I use a PPPoe connection To my adsl provider and at that special time the bandwidth is free.

    I am sick and tired of changing connection through web interface (It's slow and dummy)

    Are there any other ways of doing this?

    or Any binary to install into router so that it does this automatically?

  2. #2
    Join Date
    Mar 2007
    Location
    Budapest / Hungary
    Posts
    79
    Hi and sorry my english.

    If you use only adsl account (PPPoE, PPTP os , you can dial this script:

    Code:
    killall pppd >/dev/null 2>&1
    pppd file /tmp/ppp/options.wan0 >/dev/null 2>&1
    and disconnect
    Code:
    killall pppd >/dev/null 2>&1
    If you use two adsl account, create two new file (/opt/etc/options.wan1 and /opt/etc/options.wan2) based on /tmp/ppp/options.wan0 (and change adsl account name and password).

    You can change adsl connection, if you use two script:

    /opt/dial_adsl1
    Code:
    killall pppd >/dev/null 2>&1
    cp /opt/etc/options.wan1 /tmp/ppp/options.wan0
    pppd file /tmp/ppp/options.wan0 >/dev/null 2>&1
    /opt/dial_adsl2
    Code:
    killall pppd >/dev/null 2>&1
    cp /opt/etc/options.wan2 /tmp/ppp/options.wan0
    pppd file /tmp/ppp/options.wan0 >/dev/null 2>&1
    and the changes you can automate with cron.
    If hangup the line, the router can reconnect with adsl1 (or adsl2) definitions.

    If your isp use a automatic_ip (dhcp) or L2TP, the router use "udhcpc" program to communicate with your isp (not dial up).
    (use this command
    Code:
    udhcpc -i eth1 -p /var/run/udhcpc0.pid -s /tmp/udhcpc &
    I don't know, whitch program can to connect/to disconnect the wan adapter (send a Connect/Disconnect signal to udhcpc), my isp support only pppoe connection. If your isp combine pppoe and dhcp type connection, you must set connection type in nvram (get info: nvram get wan_proto_t )
    if pppoe: "PPPoE"
    if dhcp: "Automatic IP"

    If you use dhcp (or BigPond) connection, I find a tester for testing connect/disconnect function

    George
    Last edited by KGy; 31-07-2007 at 13:52.

  3. #3
    Sorry for the delay.
    As I'm a total newb i was trying to figure out.
    Thank you. What you said works OK but there is no command as cron i can use in telnet.

    Anyways, I came across an idea if i could only automate the router to somehow restore user settings from a file like the one we use in the web interface to backup settings and then reboot.

    Are there any scripts to do that?

  4. #4
    Join Date
    Mar 2007
    Location
    Budapest / Hungary
    Posts
    79
    Hi and sorry my english.

    0) install cron (or use busybox@crond (crond command)).
    See tutorial

    Code:
    ipkg install cron

    1) create wto adsl config file for pppd (based on /tmp/ppp/options.wan0)

    Code:
    cp /tmp/ppp/options.wan0 /opt/etc/options.wan1
    cp /tmp/ppp/options.wan0 /opt/etc/options.wan2
    and change adsl login parameter in files (.wan1 = adsl1:user/pass, .wan2 = adsl2:user/pass)

    2) create wto script:

    /opt/dial_adsl1
    Code:
    #!/bin/sh
    killall pppd >/dev/null 2>&1
    cp /opt/etc/options.wan1 /tmp/ppp/options.wan0
    pppd file /tmp/ppp/options.wan0 >/dev/null 2>&1
    /opt/dial_adsl2
    Code:
    #!/bin/sh
    killall pppd >/dev/null 2>&1
    cp /opt/etc/options.wan2 /tmp/ppp/options.wan0
    pppd file /tmp/ppp/options.wan0 >/dev/null 2>&1
    3) modify crontab (/opt/etc/crontab) file, when run dial_adsl(n) script.
    (add two line-s and change time parameters (see macsat.com manual))
    (this crontab run dial_adsl2 script at 03:00 AM, and run dial_adsl1 script at 07:00 am and the dial_adsl1 in main(master) internet connection (the dial_adsl2 is slave)...)

    Code:
    00 3 * * * admin run-parts /opt/dial_adsl2
    00 7 * * * admin run-parts /opt/dial_adsl1
    And dont't forget, these codes run on oleg fw (not on origial asus).

    Bye, George

Similar Threads

  1. Replies: 1
    Last Post: 04-05-2007, 14:53
  2. connection guard on an WL500g-XXXXX
    By rj.2001 in forum WL-500g/WL-500gx Tutorials
    Replies: 0
    Last Post: 03-05-2007, 10:18
  3. Firmware v1.9.2.7 CR1 [Oleg]
    By Oleg in forum WL-500g Firmware Releases
    Replies: 53
    Last Post: 13-04-2005, 23:26

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •