Wireless booting

Thanks to some work done during Summer of Code 2009, gPXE supports the 802.11 protocol for accessing Wi-Fi wireless networks.

Note: the contents of this page rely on some features that are not yet present in mainline gPXE, but hopefully they should be there soon.

For the curious, some implementation details are available.

Supported hardware

Because the wireless support is fairly new, gPXE does not support as many wireless cards as it does wired networking cards. If you have one of the following types of cards, you can boot over wireless:

  • Realtek 8180/8185 (supported in Linux by the rtl8180 driver; the 8180 is 802.11b-only, the 8185 is 802.11b/g)
  • All Atheros cards that do not support 802.11n (supported in Linux by the ath5k driver)

Those interested in expanding this list can read about 802.11 driver writing.

Testing a wireless boot

Set up your DHCP server as you would for a wired boot, and figure out how you're going to be loading gPXE; for a first test, burning gpxe.iso to a CD is probably the easiest option. Boot into gPXE, and press Ctrl-B to get a shell prompt. Type

gPXE> iwstat

and you should be given output similar to ifstat about all detected wireless NICs. For example, on my test machine with two wireless and two wired NICs, I get the output

net1: 00:08:54:94:fe:cc on PCI00:09.0 (closed)
  [Link:down, TX:0 TXE:0 RX:0 RXE:0]
  [Link status: Unknown (0x1a086001)]
  [802.11 not associated, antenna off]
net2: 00:22:b0:6e:bb:30 on PCI00:0a.0 (closed)
  [Link:down, TX:0 TXE:0 RX:0 RXE:0]
  [Link status: Unknown (0x1a086001)]
  [802.11 not associated, antenna off]

Note that net0 and net3 are not shown because they are not wireless NICs. (Unlike Linux, gPXE numbers wired and wireless NICs together as netX.) If you see no output from iwstat, gPXE did not detect any wireless NICs that it supports; the output of lspci -nn and lsmod | grep mac80211 under Linux would make a good contribution to the mailing list if you want to figure out why :-)

If you did find one or more wireless NICs, you can check which networks each can access:

gPXE> iwlist
Networks on net1:

[Sig] SSID                  BSSID              Ch  Crypt/Auth
-------------------------------------------------------------
[ 21] gPXE                  00:0f:66:f4:48:4a   1  WPA2  PSK
[ 19] oreman                00:12:17:e4:45:c9   6  WPA   PSK
[ 17] The Ryans             00:13:10:f6:de:23   6  WPA   PSK
[ 19] meh_wireless          00:23:69:5b:80:d3   8  Open  

Networks on net2:

[Sig] SSID                  BSSID              Ch  Crypt/Auth
-------------------------------------------------------------
[ 34] gPXE                  00:0f:66:f4:48:4a   1  WPA2  PSK
[  6] The Ryans             00:13:10:f6:de:23   6  WPA   PSK
[  3] NETGEAR               00:18:4d:54:6f:c0  11  Open  

The output will take a few seconds to show up for each NIC; hopefully the network you want to connect to is in the list! (In my case, the two cards “see” different networks because their antennas are positioned differently.) The number under [Sig] is a dimensionless measure of signal strength.

If you've found your network, or even if you haven't, you can try connecting to it, adjusting details as appropriate for your situation:

gPXE> set net0/ssid gPXE               [your network name]
gPXE> set net0/key seeecret            [for WPA-PSK or a WEP key in ASCII]
gPXE> set net0/key:hex aa:bb:cc:dd:ee  [for a WEP key in hex]
gPXE> dhcp net0
Waiting for link-up on net0... ok
DHCP (net0 00:08:54:94:fe:cc).... ok

On WPA, output like

Waiting for link-up on net0... failed: Connection reset (0x0f1f6239)
Could not configure net0: Connection reset (0x0f1f6239)

suggests that you've specified an incorrect password.

On WEP, output like

Waiting for link-up on net0... ok
DHCP (net0 00:08:54:94:fe:cc)................ Connection timed out (0x4c106035)
Could not configure net0: Connection timed out (0x4c106035)

suggests the same, especially if iwstat net0 shows a line like

[RXE: 4 x "Packet decryption error (0x1c1f6602)"]

For any other error, consult us on the Etherboot-discuss mailing list or the #etherboot IRC channel; especially remember to specify the eight-digit error code(s) beginning with 0x.

Providing initial settings

Unlike DHCP on a wired network, connecting to wireless requires that some settings be provided before any network services can be accessed at all. Specifically, you need to specify the SSID and encryption key (as above) before you can run DHCP. These are set per network device, and have the gPXE setting names netX/ssid and netX/key respectively, where X is the number of your network device.

Currently no wireless NIC has support for gPXE's NVRAM settings support, but if you have a wired NIC with such support you may be able to use the config command at the gPXE prompt to set the settings permanently. Otherwise, you'll need to create a small gPXE script and embed it. For example, put this in a file named wireless.gpxe:

#!gpxe
set net0/ssid mynetwork
set net0/key seeecret
autoboot

Compile gPXE with EMBEDDED_IMAGE=wireless.gpxe on your make command line, and boot it; it should boot off the wireless network automatically.

Congratulations on successfully booting gPXE over wireless!

Burning wireless gPXE into a ROM

Unfortunately, to the best of our knowledge there is no wireless NIC with an onboard EEPROM or a socket for a ROM. As such, if you want truly diskless booting, you'll need to use a wired NIC as a ROM carrier. Since wireless ROM images tend to get rather large, an Intel e1000 NIC is ideal; it's easy to flash and has a 128kB EEPROM built-in. Compile your ROM like

% make bin/ath5k.rom EMBEDDED_IMAGE=wireless_settings.gpxe
% ./util/modrom.pl -p 0x8086,0x107c bin/ath5k.rom   [replace with PCI IDs of your ROM-carrier NIC]

and burn bin/ath5k.rom onto your ROM-carrier NIC.