13

I am using wvdial to connect to a mobile network (I have a usb modem) and it works fine. However, I wanted to automate the connection a bit (currently I am running wvdial every time I want to connect). I was wandering if there is a way to add this network to /etc/network/interfaces (in a truly Debian way) to have it connect on startup and/or whenever I connect my modem.

Any ideas anyone?

Pylsa
  • 31,383
Grzenio
  • 3,027

5 Answers5

16

Add to /etc/network/interfaces something like

auto ppp0
iface ppp0 inet wvdial

(tested on Ubuntu Lucid)

Joril
  • 2,035
2

You need to integrate wvdial with the ifupdown system. If you want a full shell-based solution start with The alternative PPP connection with wvdialconf. But note that Debian recommends using graphical tools like the NetworkManager for configuring network connections on GUI-based desktops.

PS: That should normally be a comment but I don't have permissions to comment yet :)

sakisk
  • 121
0

To run wvdial with boucle, you can use this script and you can stop it with Ctrl+C:

#!/bin/bash     
i=1
while [ $i -le 10 ];
        wvdial 
        sleep 10
      $i
let $[ i+=1 ] 
done
dirdi
  • 3,317
0

Another good way to fix this is having a wvdial daemon to keep the connection from disconnecting.

Naveen
  • 101
  • 1
0

Try the Auto Reconnect feature of wvdial described in wvdial.conf. This option is "on" by default, so might just not work in your case.

It it does not work for you, disable it and use instead this script from ArchWiki Wvdial :

If wvdial randomly drops connection you can use script below.

#! /bin/bash
(
   while : ; do
       wvdial
       sleep 10
   done
) &
harrymc
  • 498,455