Using a Conexant PCI ADSL Modem with RedHat Linux 7
David Cutting (dcutting <at> purplepixie.org)

Introduction

I have just had installed ADSL and am (being a cheapskate and having a profound dis-belief in USB) using a 30-quid Conexant PCI ADSL modem. Tested the Modem and ADSL under Windows XP and it worked fine - then I set about the task of getting it to work under my favourite distro Red Hat.

Searching the Internet revealed a large amount of information on getting the modem to work under Mandrake along with some generic newsgroup and forum discussions regarding the steps to be taken. I also found and downloaded the required software (detailed later).

The installation steps should be fairly straightforward and seem to work fine under various versions of Mandrake. I hit a variety of problems at each stage with RedHat, these are detailed in the relevant sections below.

Brief Overview of Steps

In order to connect the system via ADSL, you must establish a PPPoA (Point to Point Protocol Over Asynchronous Transfer Mode) link. In order to do this; three main pre-requisites must be met:
  • Your Kernel must support ATM, PPP and PPPoA
    I use a stock copy of 2.4.18 compiled with gcc 2 - see the notes in the detailed kernel section below to see why
  • Your PPPd must support the pppoatm plugin
    I have downgraded my pppd to version 2.4.0 with incorporated support for PPPoA built in.
  • You must have a correctly compiled (for your kernel) copy of CnxADSL
    This is the Conexant ADSL kernel module - it will not work with Kernels compiled with GCC 3.

Kernel Compilation

Getting the kernel to work correctly with RedHat proved to be a bitch of a job. I am using RedHat 7.3 Valhalla on our main servers and mainly 7.2 Enigma on internal systems. I decided that it would probably be advisable to download the latest version of RedHat (then 8.0 - 9 came out during this process). I installed 8 and recompiled the kernel as detailed below with no problems. When I compiled the CnxADSL kernel module for my kernel, however, I discovered that the propriatory object code shipped with the CnxADSL module was compiled with gcc2 and my kernel with gcc3.

An insmod error advised me that this was 'known not to work'. I searched newsgroups and found that, indeed, it was not advisable to use a gcc2 module with a gcc3 kernel. Undeterred, I pressed on and insmod -f'd it. I was now faced with the error: undefined symbol sys_call_table.

Oh dear. Another newsgroup search and a couple of posts revealed not a lot but I did find some mentions to sys_call_table being depreciated in later kernels. Bugger. I tried a forced insmod on the 7.3 boxes with the same result (eg didn't even get to telling me that there was no ADSL card) but the 7.2 boxes gave a different error encouraging me that they would at least try to probe for the hardware.

I installed 7.2 back onto the router and with the supplied kernel sources attempted to recompile the kernel for PPPoA. I hit the next brick wall when I discovered that kernel 2.4.7 which comes with 7.2 doesn't support ATM.

At this point I decided that, given the Mandrake users were able to get the module to work with 2.4.18, I should attempt to use a stock copy of 2.4.18 from kernel.org (there is a copy available from this page in the download section).

We will now go through the steps of compiling the stock 2.4.18 kernel to utilise ATM and PPPoA. You can configure the kernel from scratch and manually input every option but I found it much better to migrate my default settings from the old kernel and just get prompted to give answers to new additions since 2.4.7.

Download and install/prepare the kernel source

# ls
linux-2.4.18.tar.gz
# gzip -d linux-2.4.18.tar.gz
# tar -xvf linux-2.4.18.tar
linux/filename....
...
# mv linux /usr/src/linux-2.4.18
# cd /usr/src/linux-2.4.18
# make mrproper
If you wish, copy across the previous kernel configurations.
# cp linux-2.4.7/configs/kernel-2.4.7-i386.config linux-2.4.18/arch/i386/defconfig
# make oldconfig
...
At this point, you will see a scrolling list of settings and be prompted to input a setting for any new additions since 2.4.7. You can just hit return to give the default to all of these.

Configure the Kernel
Cofigure the kernel using the

# make menuconfig
command. Ensure that in addition to any funky features you may want in your kernel that you enable Asynchronous Transfer Mode (ATM) in the Networking Options section and that in the Network Device section PPP and it's sub-option PPP over ATM are enabled (either with *'s as static items or M as modules). Exit and save the configuration.

Make Your Kernel

# make dep
IMPORTANT: You must now edit the Makefile and edit the 'EXTRAVERSION' line (very near the top) to look something like:
EXTRAVERSION = -adsl

Now continue making your kernel as follows:

# make bzImage
# make modules
# make modules_install
Installing and Booting Assuming all went well, you can now hopefully boot your kernel. At this stage you should also point the source tree to your kernel as follows:
# cd /usr/src
# ls -l
linux-2.4.7
linux-2.4 -> linux-2.4.7
linux -> linux-2.4.7
linux-2.4.18
# rm linux
# rm linux-2.4
# ln -s linux-2.4.18 linux
# ln -s linux-2.4.18 linux-2.4
# cp linux-2.4.18/arch/i386/boot/bzImage /boot/bzImage.adsl
You are now ready to boot your kernel. You will need to configure your bootloader. I strongly advise that you keep the existing settings in your bootloader as well just in case your kernel goes tits-up. I use LILO and my original LILO file looked like this:
prompt
timeout=50
default=linux
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
message=/boot/message
lba32

image=/boot/vmlinuz-2.4.7-10
	label=linux
	initrd=/boot/initrd-2.4.7-10.img
	read-only
	root=/dev/hda2
And I appended:
image=/boot/bzImage.adsl
	label=adsl
	read-only
Now run lilo and you should see:
Adding linux *
Adding adsl
and everything's working fine. If LILO gives an error, for the love of god do not reboot - fix it and then reboot. Otherwise, reboot and select the 'adsl' option from the boot menu (you can always make it default later).

Your kernel should now boot ok and uname should show something like 2.4.18-adsl.

Installing ATM and PPPd with pppoa

You will at this point need to install the linux-atm RPM (downloadable below) with something like:
# rpm -Uvh linux-atm-2.4.0-1.i386.rpm
The version of PPP that comes with RedHat does not support PPPoA and cannot be patched to do so. You can obtain a stock copy of pppd-2.4.0 and patch it for pppoa but I have provided a pre-patched copy in the downloads section that I assume you are using the pre-patched version provided. I have included part of a script from someone else's ADSL Conexant package that makes pppd and installs the relevant scripts and plugins. You would do this something like:
# cd ppp-2.4.0b2
# ./install.sh
Now check that it works with /sbin/pppd -v

For some reason, one of the linux routers didn't compile pppoatm.so and pppd would error (the file should be in /usr/lib/pppd/plugins). I copied the pre-compiled version from one of my boxes to the destination directory and it worked. I have made pppoatm.so available in the download section.

In order to configure your ADSL system, you will also need the scripts provided in the PPPoA support file download provided. The /etc/ppp/options file details the configuration of your ADSL account, set by default to the bt test account. Leave this for the moment, it will at least test your ADSL is up and working.

Compiling and Installing the Conexant ADSL Driver

The version most commonly found of the Conexant ADSL driver for download is setup to use kcc as a compiler, which is not supplied with RedHat. You would have to do the highly technical patch of changing the compiler from kcc to gcc in two makefiles. Although even a 2 month old Monkey could happily do this, the copy of ppp available for download here is pre-patched ;o)

You will need to build this for your kernel (you must have your kernel sources available at /usr/src/linux/ for this to work - hence the ln -s earlier). Proceed as follows:

# cd CnxADSL-2.4.3-6
# make
# cp KernelModule/CnxADSL.o /lib/modules/2.4.18-adsl/kernel/net/ipv4/
And you should be pretty much ready to rock and rolla.

Connecting the ADSL

You will need to download the PPPoA support file package available below. This will provide versions which defainately work of various config files. Simply:
# cd CnxScripts
# ./install.sh
will install the scripts as required.

You will now have some default settings in your /etc/ppp/options file which will test your ADSL by connecting to BT's test account (UK only - see the Non-UK section at the end). You can start the ADSL with:

# /etc/rc.d/rc.dsl start
and you should see 'AccessRunner Loaded'. You will get shell control back and a script sleeps in the background which waits until the ATM connection is made. You can examine the ATM link status with rc.dsl stat

After a short while, you should see 'pppoa probed'. The PPP link should now be established. You can check with /sbin/ifconfig ppp0 and in the syslog. You should see an IP address being assigned ok. Now stop the dsl connection and edit /etc/ppp/options with your username and password. You may also wish to change usepeerdns and defaultroute to suit your preferances but you will probably want them both in there.

Congratulations - your connection should now work! See the Troubleshooting section with any problems you have or email dcutting at purplepixie.org.

Future Development and Other Notes

The software provided for download is mostly as I found it online. I found and downloaded about 4 versions of just about everything but - AFAIK the ones provided for download below are the versions I have running and working.

There are a number of areas for improvement such as packaging a full system installer. I have been working on the rc.dsl script and am using quite a nice version now. I'll post any updates here as and when I finish a nicer version of anything. If you have any suggestions or additions please email me and I'll include them.

Although you can easily see the total bandwidth used by the interface with ifconfig, there is no in-built system to monitor this and provide a nice kbps/sec load totals over a set period. There are a number of third-party tools mainly utilising graphical displays. I wanted something to sit in the background and seed a data source of my choice, enabing command-line interreation with users and server side scripts. To this end, I am working on the NetLoad Deamon (netloadd), the home of which is http://www.purplepixie.org/netloadd.

Non-UK Connections

Please note that the default values provided in the options file for the VPI and VCI are for the UK (should work for all UK ADSL connections) but will not necessarily work abroad. The BT test ADSL account will also definately not work from abroad. You will need to check with your ISP for their relevant settings and test account details.

Troubleshooting

I connect, get a IP address but cannot ping anyone or resolve any hosts
Your route is probably not being set. Try:
# /sbin/route del default
# /sbin/route add default ppp0
and this will point packets to the ppp0 device if they are not for local or LAN delivery. You can check the routing table with /sbin/route (use -n if no host lookups are occuring).

I stopped the rc.dsl during connection and now I'm getting non-stop errors on the console
The if-up.sh script sits in the background monitoring the state of the ATM line until it comes up and then instigates ppp. If you stop rc.dsl before this PPP connection is made the script will run forever. A ps -aux will allow you to see the PID of the if-up.sh script and kill it.

I have an internal DNS server and wish to be able to resolve local hosts as well as remote hosts
Hash out the usepeerdns line from your /etc/ppp/options file. In /etc/resolv.conf enter the address of your internal nameserver along with your ISP nameservers (local one first). If your ISP nameserver addresses change, you may have to run an external DNS server on the router or internal nameserver.

Download Software

PackageSize Download
CnxADSL_2.4.3-6.tar.gz
Conexant PCI ADSL Modem Drivers
1.4 Mb HTTP | FTP
ppp-2.4.0b2.tar.gz
Version 2.4.0 of PPPd with pppoa support - see READMEFIRST
600 kb HTTP | FTP
linux-atm-2.4.0-1.i386.rpm
Linux ATM Support RPM
500 kb HTTP | FTP
CnxADSL-Support.tar.gz
Linux ATM Support RPM
1.6 kb HTTP | FTP
pppoatm.so
Precompiled pppoatm.so plugin for ppp (/lib/ppp/plugins/)
150 kb HTTP | FTP
CnxADSL-2.4.tar.gz
All the above files in one package (no kernel source)
2.6 Mb HTTP | FTP
linux-2.4.18.tar.gz
Linux 2.4.18 Stock Kernel
30 Mb HTTP | FTP


I have written this very very quickly and it will be full of spulling mistikes.
Please report any errors or broken links etc to dcutting at purplepixie.org.