OpenWrt Forum Archive

Topic: pppoa interface not being brought up automatically on startup (ar7)

The content of this topic has been archived on 30 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I have the following wan interface block in my /etc/config/network file:

config interface wan
        option ifname   atm0
        option proto    pppoa
        option encaps   llc
        option vpi      0
        option vci      38
        option username "mylogin"
        option password "mypassword"

But the interface isn't being brought up on router startup. I have to log into the router and manually run:

ifup wan

Is there a reason why openwrt isn't bringing this interface up automatically on startup?

I'm running openwrt ar7-2.6 built from svn r10224.

thanks,
rob.

Additional information... the output of 'lsmod' immediately after startup is:

Module                  Size  Used by    Not tainted
tiatm                 141696  0 
pppoatm                 4448  0 
nf_nat_tftp             1120  0 
nf_conntrack_tftp       3760  1 nf_nat_tftp
nf_nat_irc              1856  0 
nf_conntrack_irc        4848  1 nf_nat_irc
nf_nat_ftp              2464  0 
nf_conntrack_ftp        6944  1 nf_nat_ftp
ppp_async              11616  0 
ppp_generic            26944  2 pppoatm,ppp_async
slhc                    6080  1 ppp_generic
crc_ccitt               1472  1 ppp_async
br2684                  7312  0 
atm                    48560  3 tiatm,pppoatm,br2684

So I don't think it's a hotplug issue.

This is ATM over ADSL, right?  I think the problem is that the hotplug infrastructure does not detect the ADSL modem training status, so it doesn't actually know when a PPP session is possible or impossible. I'm not sure whether this is a deficiency in the driver or in the scripts... how does interface configuration work for ethernet NICs when link comes and goes?  Is that the job of the DHCP client layer to poll the NIC for its link status (and so an equivalent script is needed for polling the ADSL device)?

There was another thread about this issue, including automatically reconnecting in general. I've had to write my own script that polls the status and restarts the interface not just at boot but sometimes much later when ADSL sync is lost and my PPPoE session is not reset properly when the sync is restored.

The hotplug support in the AR7 ADSL modem driver IIRC is still WIP, but NRForbes has been making some excellent progress towards this. You can experiment with his offerings at https://dev.openwrt.org/ticket/2996

As for the meantime, I get around this problem by adding the following hack to /etc/init.d/rcS :

sleep 35 ; /sbin/ifup wan  &

I have uploaded a new patch to ticket #2996 which contains just the DSL hotplug support, so you can use it without all the LED stuff. You'll need to create a file in /etc/hotplug.d/atm which contains the commands you want run for each event.

As an example, this is what I had in a file called 10-leds to change the LED state as the line syncs - I am sure you can adapt it to do what you require:

DSL_LED="adsl"  
case "$ACTION" in  
        add|TEST|IDLE)  
             led_on "$DSL_LED"  
        ;;  
        INIT|HANDSHAKE|RETRAIN)  
             led_timer "$DSL_LED" 300 200  
        ;;  
        SHOWTIME|remove)  
             led_off "$DSL_LED"  
        ;;  
esac

Please let me know how you get on if you give this a go as I'd be very interested in any feedback you have.

Nick.

(Last edited by NRForbes on 23 Jan 2008, 19:34)

The discussion might have continued from here.