PPPoA
From Gentoo Linux Wiki
| Installation • Kernel & Hardware • Networks • Portage • Software • System • X Server • Gaming • Non-x86 • Emulators • Misc |
Please format this article according to the guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article
|
WARNING: I'm no longer maintaining this article! I had a bunch of problems with these drivers and although I know they work for other people I've given up. Please feel free to edit this page - I'll no longer respond to emails regarding this HOWTO. Stroller |
Contents |
[edit] Preamble: ADSL, PPPoA & a Conexant PCI Card
Being based in the UK, I am able to subscribe to a "broadband" service supplied over cables belonging to our National Telephone Monopoly - thanks for that, Baroness Thatcher! This means that I pay twice as much for a 1Mbps connection as the Japanese pay for 10Mbps, yet I suffer a painfully low upload bandwidth of 256kbps, not to mention a service that is disconnected for an average of 5 days per year when a sparrow shits on the cables. But I digress...
The Conexant "Accessrunner" is a range of ADSL modems which handle the esoteric PPPoA service used in the UK, New Zealand, Italy and probably elsewhere. A Google search suggests that PPPoA is also used in Russia, Argentina & Spain, although I can't be sure because the authors of those webpages haven't bothered to write in English.
I'm interested in the PCI version of the Conexant "Accessrunner", so my router will sit in a single neat box. This card is available from WorldNet in New Zealand and from Dabs.com (and undoubtedly from reputable suppliers, too) in the UK. If you already have a USB Accessrunner modem, then take a look at http://accessrunner.sourceforge.net/
Placement of the above link is not by any means an endorsement of Dabs.com - they have the worst customer service I've ever encountered - if you find another UK supplier, please let me know so I can update this page.
At time of writing (July 2005) Ebuyer have this product available, use QuickCode 37969. The product is listed on their site as a Dynamode ADSL PCI Modem, but close examination shows that the "Manufacturer" Code, M-ADSL-PCI-C, is the same as that listed on the dabs website. About Ebuyer: Ebuyer is an odd but extremely competitively priced site: they cannot be contacted by telephone AT ALL; any communication via their website has a delay of approximately two to four days whilst they get to it: think what chaos this brings on delivery of goods...
As of November 2006 no online shop seem to stock the card, but several are on offer on eBay, and have been for at least a month. Search for M-ADSL-PCI-C or Conexant Accessrunner.
Update, as of December 2006 a card which uses the Conexant AccessRunner chipset is available here http://www.clickonit.com/item/84623 . This is not an endorsement of ClickonIT but I've not had any negative experiences with them.
[edit] Installing the driver module
A chap called Patrick Mackinlay has written the definitive resource for running this chipset under Linux, so that might be worth a look before you go any further. The bad news is that there's no ebuild to do the work for us, so we'll have to do this the old-fangled way.
| Code: Checking that your PCI card is installed & recognised as a Conexant |
$ lspci | grep -i accessrunner 0000:00:0a.0 System peripheral: Conexant ADSL AccessRunner PCI Arbitration Device (rev 01) 0000:00:0a.1 ATM network controller: Conexant AccessRunner PCI ADSL Interface Device (rev 01) |
It is assumed you're using a 2.6 kernel. This has been tested on 2.6.17-gentoo-r8.
# CONFIG_REGPARM is not set
Processor type and features --->
[ ] Use register arguments (EXPERIMENTAL)
CONFIG_ATM=y
Device Drivers --->
[*] Networking support
Networking options --->
<*> Asynchronous Transfer Mode (ATM)
CONFIG_PPP=y
CONFIG_PPPOATM=y
Device Drivers --->
[*] Networking support
<*> PPP (point-to-point protocol) support
...
<*> PPP over ATM
I don't actually think we need PPP filtering enabled to allow us to firewall or NAT the ADSL connection, but I'm not absolutely certain. I think this is only used to control which packets are able to bring PPP links up for dial-on-demand, which we're not worried about on ADSL, but I'm gonna enable it to be on the safe side. If anyone can provide me with more info about this, I'd be grateful.
CONFIG_PPP_FILTER=y Device Drivers ---> [*] Networking support <*> PPP (point-to-point protocol) support ... [*] PPP filtering
As explained by Unixhead.org Patrick's kernel driver includes an init script we aren't going to use. I reckon there's probably a more elegant way to handle this, but this works
# mkdir -p /etc/rc.d/init.d
| Code: Installing the kernel driver |
# # If you have a 2.6.9 or 2.4.28 or earlier kernel # CURRENT_DRIVER=CnxADSL-6.1.2.007-PIM-2.6-1.1 # # If you have a 2.6.10 or 2.4.29 or later kernel # CURRENT_DRIVER=CnxADSL-6.1.2.007-PIM-2.6-1.5 # wget -nv http://patrick.spacesurfer.com/adsl/$CURRENT_DRIVER.tar.bz2 02:59:42 URL:http://patrick.spacesurfer.com/adsl/CnxADSL-6.1.2.007-PIM-2.6-1.1.t ar.bz2 [1291138/1291138] -> "CnxADSL-6.1.2.007-PIM-2.6-1.1.tar.bz2" [1] # tar -xjf $CURRENT_DRIVER.tar.bz2 # ls $CURRENT_DRIVER CHANGELOG FilterLog.awk Makefile cnxadslctl-orig CHANGELOG~ FilterLog.sh buildcnxadsl.sh cnxadslremove.sh CommonData.h Instructions buildcnxcvs.sh cnxadslrpm.spec ConfigLabels.h KernelModule buildcnxrpm.sh minirc.dfl DownLoadApp LnxDefs.h chgmodscripts.sh FilterDiff.awk Log.txt cnxadslctl # cd $CURRENT_DRIVER && make && make install # /sbin/depmod -a |
We now need to remove that init script we're not using
# rm /etc/rc.d/init.d/cnxadslctl && rmdir /etc/rc.d/init.d && rmdir /etc/rc.d/
This is "Redhat safe" - it will fail in the event that you have anything else in /etc/rc.d/
[edit] Testing it works
[edit] PPPoA & Authenticating To The ISP
If you've done your homework already, you'll have seen how the authors of the other references on setting this up patch ppp to include PPPoA support. But taking a look on the ppp website indicates that a PPPoA patch is already included in later versions:
| Code: |
This is the README file for ppp-2.4, a package which implements the Point-to-Point Protocol (PPP) to provide Internet connections over serial lines. ... What's new in ppp-2.4.3. ************************ ... * There is a new pppoatm plugin, by various authors, sent in by David Woodhouse. |
It turns out that this is already in Portage, along with a matching atm USE flag. This pulls in net-dialup/linux-atm as a dependency - it looks to me from locate atm.h that these libraries are now part of the main kernel tree, but presumably we still need the tools for ATM part of the ebuild.
| Code: Getting a current version of ppp |
# emerge ppp -pv These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] net-dialup/ppp-2.4.3-r16 USE="atm ipv6 pam -activefilter -dhcp -eap-tls -gtk -mppe-mppc -radius" 0 kB Total size of downloads: 0 kB # emerge ppp |
Only USE="atm" is required.
[edit] Init.scripting
Now we need to replace that init script with something useful. I grabbed a copy from Unixhead.org, but it seems he's running a 2.4 kernel, and that my system required some changes, also, I have fixed some bugs. (see the changelog)
Here's my version of the start-up script in all its glory:
| File: /etc/init.d/cnxadsl |
#!/sbin/runscript
#
# This is the boot/shutdown script for the driver for the
# Conexant AccessRunner ADSL modem.
#
# Changelog:
# - now it determines whether PCI card exists or not
# - missing "fi" is fixed
# - indicates when firmware is loaded
# - now it uses modprobe instead of insmod
# - wait for line to sync before returning, times out after 2 minutes
# determine if we are loading or unloading
opts="start stop status"
depend() {
after modules
}
start() {
# if the driver is not already loaded then
# Load the module
if lspci | grep -q 'System peripheral: Conexant ADSL AccessRunner'; then
if [[ `lsmod | grep -o -e "CnxADSL"` ]] ; then
eerror "Conexant PCI ADSL Modem is already loaded"
eend $?
else
ebegin "Starting Conexant PCI ADSL Modem"
modprobe CnxADSL \
CnxtDslVendorId=0x14F1 \
CnxtDslArmDeviceId=0x1610 \
CnxtDslAdslDeviceId=0x1611 \
CnxtDslPhysicalDriverType=1 >/dev/null 2>&1
eend $?
ebegin "Conexant firmware loaded"
/etc/Conexant/cnxadslload -i0 /etc/Conexant >/dev/null 2>&1
sleep 1
einfon "Waiting for CnxADSL to sync ."
sleep 5
cnt=0
while [ -n "$(grep ^Line /proc/net/atm/CnxAdsl\:0 \
| grep "Not available")" ]
do
cnt=`expr $cnt + 1`
if [ $cnt -gt 27 ] ; then
# Waited 60 seconds now. Fail.
echo
eend 1 "Failed."
break
fi
sleep 2
echo -n "."
done
echo
eend 0
fi
fi
}
stop() {
# if the driver is started then stop it
if [[ `lsmod | grep -o -e "CnxADSL"` ]] ; then
ebegin "Stopping Conexant PCI ADSL Modem"
#kill pppd if running
if [ -x /etc/init.d/net.ppp0 ] ; then
/etc/init.d/net.ppp0 stop >/dev/null 2>&1
else
if [[ `ps ax | grep pppd | grep -v grep` ]] ; then
ps ax | grep pppd | awk '{print $1}' \
| xargs kill -9 >/dev/null 2>&1
fi
fi
#unload the module
modprobe -r CnxADSL
eend $?
else
ebegin "Conexant PCI ADSL Modem was not loaded"
eend $?
fi
}
status() {
if [[ `lsmod | grep -o -e "CnxADSL"` ]] ; then
cat /proc/net/atm/CnxAdsl:0
else
echo "Conexant PCI ADSL Modem is not loaded"
fi
}
|
| Code: Checking the init script works |
# /etc/init.d/cnxadsl status * status: stopped AccessRunner is not loaded # /etc/init.d/cnxadsl start * Starting Conexant PCI ADSL Modem ... [ ok ] * Conexant firmware loaded ... * Waiting for CnxADSL to sync .............. [ ok ] # /etc/init.d/cnxadsl status * status: started Conexant AccessRunner PCI ADSL Modem Adapter Status ---------------------------------- ADSL Line Connected Line Rates: Receive 4544 kbps Transmit 448 kbps ADSL Modulation:G.DMT, Rate Unlimited / Full Rate ATM Virtual Channel IDs: VPI: 0 VCI: 38 Physical Layer Stats: Receive Transmit Noise Margin 6.32/ 4.66: 175 127.99/127.99: 0 Attenuation 45.25 28.00 Power -38 ATM Link Stats: Receive Transmit Bytes 9381 10123 Cells 177 191 Management Cells 0 2 CLP=0 Cells 177 1 CLP=1 Cells 0 190 HEC Errors 0 Alignment Errors 0 Unroutable Cells 0 AAL Link Stats: Receive Transmit Good Bytes 8496 3648 Good Frames 132 134 Discarded Bytes 0 Discarded Frames 0 CRC Errors 0 Invalid Length Errors 0 Timeout Errors 0 ATM Channel Stats: Receive Transmit Bytes 9381 10017 Cells 177 189 Mgmt Cells 0 1 CLP=0 Cells 177 0 CLP=1 Cells 0 189 HEC Errors 0 Alignment Errors 0 Unroutable Cells 0 AAL 5 Channel Stats: Receive Transmit Good Bytes 8496 3648 Good Frames 132 134 Discarded Bytes 0 Discarded Frames 0 CRC Errors 0 Invalid Length Errors 0 Timeout Errors 0 Driver version - 6.1.2.007-PIM-2.6-1.4 (14072005) EE PROM Mac Address 00.30.cd.00.01.00 # /etc/init.d/cnxadsl stop * Stopping Conexant PCI ADSL Modem ... [ ok ] # /etc/init.d/cnxadsl status * status: stopped AccessRunner is not loaded # |
The file which sets the ADSL parameters is /etc/Conexant/cnxadsl.conf
| Code: Checking VPI & VCI are set correctly |
# grep ATM /etc/Conexant/cnxadsl.conf ATM_VPI 0 ATM_VCI 38 |
0/38 is correct in North Buckinghamshire, West Yorkshire, and all areas of the UK served by BT - foreigners may need to change it.
And for the moment of truth, unplug your current ADSL device, connect the Conexant & see if it detects your line. I found it took about 30 seconds or so to initialise. I (Gaima) had the phone line connected at the time of updating the above example output from the init script.
| Code: The moment of truth! |
# until false ; do grep "^Line Rates" /proc/net/atm/CnxAdsl\:0 ; sleep 5 ; done Line Rates: Not available Line Rates: Not available Line Rates: Not available Line Rates: Not available Line Rates: Not available Line Rates: Not available Line Rates: Not available Line Rates: Not available Line Rates: Not available Line Rates: Not available Line Rates: Not available Line Rates: Not available Line Rates: Receive 2272 kbps Transmit 288 kbps Line Rates: Receive 2272 kbps Transmit 288 kbps Line Rates: Receive 2272 kbps Transmit 288 kbps ^C # |
[edit] conf.d/net config
Now that baselayout (1.12.x) supports defining ppp settings in /etc/conf.d/net ppp setups really couldn't be easier. This is mine, minus password, etc.
| Code: /etc/conf.d/net |
depend_ppp0() {
need cnxadsl
before ipsec ntpd
}
config_ppp0=( "ppp" )
link_ppp0="0.38" # PPPoA requires the ATM VC's address
plugins_ppp0=(
"pppoa vc-encaps" # Required plugin for PPPoA with an option
)
username_ppp0='ausername'
password_ppp0='apassword'
pppd_ppp0=(
"+ipv6"
"debug" # Enables syslog debugging
"noauth" # Do not require the peer to authenticate itself
"defaultroute" # Make this PPP interface the default route
# "updetach" # If not set, "/etc/init.d/net.ppp0 start" will return
# "usepeerdns" # Use the DNS settings provided by PPP
"lcp-echo-interval 15" # Send a LCP echo every 15 seconds
"lcp-echo-failure 3" # Make peer dead after 3 consective
# # echo-requests
)
routes_ppp0=( "::/0" )
|
There are certain options you can ignore, as they may be unique to my setup. You may not use ipsec, or ntp so no need to depend on them. You may also not use IPv6, so you can safely ignore "+ipv6" and routes_ppp0. I don't use my ISPs DNS servers, you may want to, so turn on usepeerdns. Without updetach ppp will wait for it to connect (or fail) before returning.
[edit] References
Since there's no ebuild for these drivers & they're not in the main kernel, things are subject to change and so I've listed the last-changed dates for each of these resources. If you run into problems you may find the differences between these to be very relevant.
- http://patrick.spacesurfer.com/linux_conexant_pci_adsl.html - the definitive reference. At the time of writing Patrick Mackinlay seems to be the "current maintainer" of this driver - 2.6.10 support will probably appear here first. Updated Feb 2 2005, only 3 weeks ago at the time of writing.
- http://www.wlug.org.nz/AccessRunnerADSLModem - very clear & concise, updated October 8, 2004
- http://www.unixhead.org/docs/conexant/linux-conexant-howto.html - proper traditional HOWTO style, mentions Gentoo by name, but 2003, I think.
- http://www.adslteknikservis.com Adsl.
- http://www.digitaltrickery.com/conexant-pci-notes.html - looks like a competent & decent write-up, but I haven't studied it thoroughly & it's dated July 2003.
- http://gateway.bedroom.gen.nz/~clive/adsl/thefiles/CnxADSL.html - not very readable, but October 2004. Contains many references to 2.4 kernels, so may be very relevant of you're using one of those. Very comprehensive set of links at the bottom of the page.
