WiFi wireless networking on MacBooks generally works under Debian, sometimes out-of-the-box, but support and configuration depend on the specific hardware (and kernel support for it), and may require some hacking.
If the card is supported by the kernel, then there is nothing special about a MacBook, and one may refer to the common WiFi instructions in case of problems; if the card is not supported by your running kernel, then some hacking may be required.
Initial setup and check
If you’ve installed Debian with the Laptop or Gnome-Desktop installation, you have the basic necessary tools; otherwise install wireless-tools for wireless, and optionally NetworkManager for a user interface (so you can select a network), or use an alternative, as discussed at WiFi.
To start, try running iwconfig.
If iwconfig doesn’t run, please install wireless-tools and then try again (or use the full path, /sbin/iwconfig).
If iwconfig runs and shows a WiFi card, your hardware configuration is probably ok, and you should try to connect to your desired network using NetworkManager, iwconfig, or other tools; return here if you have reason to believe that you do, in fact, have hardware problems.
If iwconfig runs and does not show a WiFi card, and you do have a WiFi card (as all Intel ?MacBooks do), then you have a hardware configuration problem, and this is the page for you!
Getting packages
It is significantly easier to setup wireless with a working (wired) network connection, for installing packages and finding documentation.
If you do not have access to a wired connection, you can boot into Mac OS X (if you are dual-booting) and download required packages, or else obtain them from a separate computer with working wireless connection, but these both may involve multiple back-and-forth cycles and using dpkg manually instead of aptitude/apt-get.
Identify wireless card
The first step is to identify your network card; "AirPort" and "AirPort Extreme" are Apple product names for varying hardware, with "AirPort Extreme" meaning "IEEE 802.11g" (and for more recent cards, /n (802.11n)). Different cards require different configuration.
Under GNOME or KDE, one can use a graphical application, as described at How to Identify PCI. Alternatively, one can check manually via:
update-pciids # if necessary; run as root, to update PCI database lspci | grep -E "Atheros|Broadcom" # Finds card
MacBooks before the late 2008 models use Atheros chipsets, while late 2008 are now using Broadcom 4322 chipset.
Some Atheros models work out-of-the-box with more recent (lenny) kernels; Broadcom chipsets all require non-free firmware, and thus require some user intervention.
Broadcom chipset
Broadcom has developed a driver, which contained a closed part.
the driver can be downloaded from here:
http://www.broadcom.com/support/802.11/linux_sta.php
Note: I'm using Debian Lenny with kernel 2.6.26-1-amd64on a new unibody MacBook Pro. I found that an earlier version of the Broadcom driver (hybrid-portsrc-x86-64_5_10_27_6.tar.gz) could provide "iwlist eth1 scan" results and could send DHCP requests. However, this version never received an address, even though my router was handing out IPs to my other machine. But when I upgraded to the latest version (hybrid-portsrc-x86-64_5_10_27_11.tar.gz) I got wireless working both unencrypted and with 64-bit WEP.
Note: After following the Broadcom README, you need to 'cp wl.ko /lib/modules/2.6.26-1-amd64/kernel/net/wireless' and run 'depmod -a'.
For >= 2.6.27 kernels, you need a patch to compile the driver, see:
http://ubuntuforums.org/showthread.php?t=896713&page=5
[Richard Shore: I have only been able to get the Broadcom wireless working following this slightly more detailed guide. It's written for a Macbook Pro using Etch, but it's the only thing that's worked for my late 2007 Macbook, for Lenny, both i386 and amd64. [javascript:void(0);/*1236686532710*/ http://dendiz.verisux.com/2008/11/27/installing-debian-on-a-macbook-pro-part-2/]]
Atheros chipset
There are three possibilities for Atheros chipset:
- ath9k – preferred, completely free
- madwifi – mostly free
- ndiswrapper – mostly closed
ath9k is a completely free driver, without any firmware, which make it the preferred version for users of lenny and more recent releases. madwifi and ndiswrapper are still mentioned for people not having a kernel recent enough, notably etch users.
Ath9k
Atheros is now providing support for (>=) AR5416 cards with the ath9k driver.
See http://wireless.kernel.org/en/users/Drivers/ath9k for more details.
User reports
At least in the initial black MacBook, ath5k works fine. WPA does not seem to work on white ?MacBook1,1. Use madwifi.
- Ath9k is now part of linux 2.6.27, and this version appears to work pretty well on my black macbook with an Atheros ar5418. There are a few bugs but it doesn't affect my traffic. This is tested using open and WPA.
- There are drivers backported to 2.6.26 and earlier by the linux-wireless project, however i couldn't get these to work. Looking through the changelogs shows that they haven't had as much attention lately, however this is probably due to 2.6.27. This is the compat-wireless branch.
- I now run a custom 2.6.27 kernel on lenny as the madwifi drivers were not reliable. There were no issues with the installation.
- 802.11n is also supported by I haven't tried that yet.
Madwifi
Madwifi is the earlier, partly non-free series of Atheros drivers; it also has some issues with WPA, as discussed below.
To use this, you will need to build kernel modules. For some cards, this can be largely automated via module-assistant, but for some cards, notably the AR5008 (PCI-ID 168c:0024), you cannot use module-assistant as of this writing, and must instead install an unofficial release manually.
Most cards
Add 'contrib' and 'non-free' to your main Debian repository then update your packages list with
aptitude update
Install the madwifi kernel module source and the ability to compile it
aptitude install module-assistant
Compile it
m-a prepare m-a a-i madwifi modprobe ath_pci
See http://madwifi-project.org/wiki/UserDocs/Distro/Debian/MadWifi for more details.
Note: the current stable madwifi debian package (0.9.2+r1842.20061207-2etch1) isn't compatible with the latest stable kernel versions (2.6.22.1) -- use madwifi-source from Debian testing.
AR5008
The airport card in the newest MacBook (AR5008, PCI-ID 168c:0024) is working with a svn version from madwifi (with WPA support). This was added in branch madwifi-hal-0.9.30.13 which was then merged back into the trunk, as noted in http://madwifi-project.org/ticket/1001#comment:194 The quick and ugly way until 0.9.30.13 or later is available as .deb package:
svn checkout http://svn.madwifi-project.org/trunk madwifi-hal-0.9.30.13 cd madwifi-hal-0.9.30.13/ make make install
or:
apt-get install wget wget http://snapshots.madwifi-project.org/madwifi-hal-0.9.30.13-current.tar.gz tar zxfv madwifi-hal-0.9.30.13-current.tar.gz cd madwifi-hal-0.9.30.13/ make make install
The 0.9.30.13 version seems buggy on macbook core 2 duo 2 Ghz (the driver stops working after a while). Unfortunately, even the subversion version is buggy (as of 12/08/2007) :
$ dmesg | grep wifi | uniq -c | tail -n 1
576 wifi0: rx FIFO overrun; resettingMaybe there is a solution in the discussion http://ubuntuforums.org/showthread.php?t=587366.
WPA
Note: if you use WPA, the wpa_supplicant from squeeze does not support the madwifi private interface, and the wext interface of the madwifi driver des not go along well with wpa_supplicant. You will need to recompile wpa_supplicant to use WPA with a madwifi driver.
Ndiswrapper
The following procedure worked on etch/i386 with card AR5008 (PCI-ID 168c:0024).
Get the D-link DWA645 card drivers for Windows XP from somewhere (for example from http://www.dlink.com/products/support.asp?pid=489&sec=0 as suggested in http://madwifi-project.org/ticket/1001#comment:13)
This is a zip file: dwa645_drivers_102.zip Unzip it. You will need the files ar5416.sys and net5416.inf from the Driver subdirectory.
The D-link driver not permit to scan wireless networks arround. Is possible get this feature using the driver of ThinkPad 802.11abgn wireless LAN driver, avaliable in http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-66449 . You need to get the file 7iwc28ww.exe, and extract with cabextract. Are the same files, but in a newer version.
Run the following:
aptitude install module-assistant m-a prepare m-a a-i ndiswrapper ndiswrapper -i net4516.inf
The last command has to be run in the "Driver" directory, it copies the driver into /etc/ndiswrapper and does some additional setup.
Proceed to the "Common setup" subsection. Just make sure you add the following
pre-up modprobe ndiswrapper
post-down rmmod ndiswrapperright after the "iface ath0 inet dhcp" line.
Common setup
To start wireless up on boot, add the following to /etc/network/interfaces (unless you intend to use NetworkManager, in which case you don't need this)
# Starts the wireless card on boot auto ath0 iface ath0 inet dhcp
Restart networking.
/etc/init.d/networking restart
