The Mysterious and Handy dsl-modem.agent

I stumbled upon this file when trying to debug a problem with my USB ADSL modem, and since I couldn't find much documentation online (I basically guessed everything I'll post here), I thought it would be helpful to post about this file in case somebody else finds it useful.

You see, the thing is that, despite the fact that most people say hardware support in Linux is still poor (something I strongly disagree), everyone must agree that, when there's support for a given piece of hardware, there's actually a great support for it. One great example is my Paradyne 6025 USB modem, which is supported by the ueagle-atm driver, now part of the kernel tree (it wasn't when I first started using it). Since it has always been plugged to my Debian computer, I had a configuration in /etc/network/interfaces that used pre-up and post-down commands to run br2684ctl to initialize the nas0 interface. That worked fine, until I started having problems with the USB modem disconnecting constantly, probably because of static. After I gave up trying to prevent it from disconnecting, I realized I had to cope with the fact that it would keep disconnecting, so I started looking at a udev workaround for that which could automatically handle the reconnection.

The funny thing is I didn't have to do anything: I found the dsl-modem.agent rule at /lib/udev which actually did everything for me with respect to br2684ctl. If you open the file, you'll see it's heavily documented, and I found the provided documetation useful enough to get me rolling with a propper setup on the /etc/network/interfaces file. The only thing I didn't find there, and couldn't find on the web, was how to pass the VP and VC values br2684ctl needs to setup the connection. Fortunatelly, I was well documented about udev in that moment, so after reading the whole dsl-modem.agent script I concluded I needed to pass those through a udev rule, so I modified the line in /etc/udev/rules.d/80-drivers.rules that calls dsl-modem.agent to look like this:

[code lang="bash"]
SUBSYSTEM=="atm", ENV{PROTOCOL}="2684bridged", ENV{VP}="1", ENV{VC}="32", RUN+="dsl-modem.agent"
[/code]

and problem solved :) I found out this script is not included in other distros like Gentoo and Ubuntu, but if you need it in your distro, I'm sure it would be enough to copy it from a .deb Debian package.