OpenWrt Forum Archive

Topic: starting a PPP interface at boot?

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

I've got a USB 3G modem working with 8.09rc1 on my WRTSL54GS.  I have to manual execute a "ifup ppp0" command to get it to connect.  Is there something simple I can put in one of the config files that will automatically bring up ppp0 when the router boots?

Thanks!
Eric

Hi.

You should install the "comgt" package. Then define your wan that way:

config interface wan
  option proto        3g
  option apn          provider-apn
  option maxwait      10            # time to wait for modem initialisation
  option device       /dev/ttyUSB0  # modem device
  option service      umts          # or grps / evdo / cdma
  option username     username      # optional
  option password     password      # optional
  option pincode      1234          # pin number

There is a bunch of other options inherited from the generic ppp configuration.
Also take a look here: http://dev.luci.freifunk-halle.net/docs … erface.xml

~ JoW

(Last edited by jow on 16 Dec 2008, 10:30)

I use the setup as described above by JoW

Then I made a bootup script in /etc/rc.d/ to issue the command "ifup wan"

It works as advertised.


edit: My S95done

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org

START=95
boot() {
        [ -d /tmp/root ] && {
                lock /tmp/.switch2jffs
                firstboot switch2jffs
                lock -u /tmp/.switch2jffs
        }

        # set leds to normal state
        . /etc/diag.sh
        # bring wan (3g datacard) up late (modules load late)
        ifup wan
        set_state done
}

I had to put the command in the last startup script because the usbserial driver loads very late in bootup.

(Last edited by aport on 16 Dec 2008, 22:05)

Hi.

Have you tried to increase "maxwait" to sth. like 120 seconds or so?

~ JoW

The discussion might have continued from here.