From BCCD 3.0
BCCDv3 -- Configuring and Customizing
The BCCD does its best to automatically configure itself for your network environment using the
bccd-nic-setup script. This script follows the BCCD Credo: Hit Enter Until It Works, Unless You Know Otherwise. There are some instances when you need to supply information or perform some manual steps, which means You Know Otherwise.
Here's some scenarios:
Head Node/Parent/First BCCD
This follows the BCCD Credo closely.
bccd-nic-setup will prompt for what network you want other BCCD systems to connect to
---you might think you only want one BCCD on the network, but one inevitably turns into more---and you should press enter. The script will then display any network information available from DHCP
to which you should hit enter. If the BCCD is unable to find network information for a NIC, it will default to skipping it.
If you know what your network information is, you can select No and supply your own IP address, subnet mask, and optionally a gateway. If you don't specify a gateway, it will default to the IP address you type in.
The system will now continue booting up, and start up a DHCP server in case you ever want other BCCD systems on this network. Note that the DHCP server only answers requests from BCCD clients, and will serve up addresses on the private 192.168.3.0/24 network so as not to interfere with other non-BCCD network clients.
Compute Node/Child/2nd-through-N BCCDs
Putting another BCCD on the network is easy. Make sure you already have a BCCD DHCP server on the network by following the steps above steps above. Then, simply bring another system on the network. If you have only a single NIC, you won't get a prompt at all, and the system will continue booting with the network information supplied by the BCCD server.
If you do have multiple NICs, you should a screen showing that your second system has found its BCCD server, and you'd just hit enter to accept those settings.
Your default route will point through the first BCCD server on the network, so you'll be able to access the Internet assuming the first BCCD server can access the Internet.
For any non-BCCD NIC prompts, you can just hit enter.
BCCD PXE booting
BCCD PXE booting is only supported from a Liberated (not Live) BCCD.
Make sure your BCCD network is NOT also connected to a wider network that has its own DHCP server, e.g. a campus network, because running a PXE server on such a network may cause other machines outside your BCCD network to try to boot as BCCDs instead of whatever operating system they are supposed to boot into (e.g. a Windows computer lab). You should make sure that ONLY the machines that should be booting BCCD are connected in the network, and NO other routers are connected to that network. If any of the nodes in your BCCD cluster have a separate NIC, you can use that NIC to connect that node to the wider network without having to worry about machines outside the BCCD network PXE booting into BCCD.
- To start, reset your network configuration:
$ sudo bccd-reset-network<ENTER>
- You will be prompted to select a NIC for the BCCD network. If more than one NIC is listed, you will need to select the NIC that is hooked into the network you want to use for the BCCD cluster.
- After you have selected the correct NIC, it will ask you to select No to configure PXE/diskless booting. You should select No.
- Then it will ask you if you want to make that NIC PXE-capable. You should select Yes.
- It will then ask if you want to accept auto-configuration for a virtual NIC, i.e. one that ends with :1, e.g. eth0:1. You should select Yes.
You should now be able to boot other machines on the BCCD network into your cluster via PXE.
There are three steps to configuring wireless internet: identifying the network to use, configuring encryption, and connecting to the network. Currently, this guide will support connecting to unencrypted/WPA/WPA2 networks, while a section for WEP will be added later.
Scanning for Networks
Assuming you have a wireless device, the first step is to determine which wireless network to use. Usually, you will have some idea of what it is, but it helps to gather information. The
iwlist command will list all wireless networks that are currently broadcasting in range to a specific device:
- Get a list of all wireless networks:
$ iwlist [device] scan
- Get a list of network names only:
$ iwlist [device] scan | grep -i essid
- Get a list of networks with some string (the SSID) in their name (replace
YOUR_SSIDwith the actual SSID):
$ iwlist [device] scan | grep "YOUR_SSID"
It is important to note that just because a network does not appear in the listing does not mean the network does not exist. Some wireless networks are specifically set not to broadcast, which means their information won't appear. In this case, you need to get information from the network administrator about the name and encryption type of the network.
If you are able to find a suitable network, you now need to gather information about it. Run
iwlist again, without any sort of
grep. This will provide detailed information about each network -- find the network of interest within this output. Information about a device should look like the following:
Cell 04 - Address: 00:22:0D:E0:6A:99 Channel: 56 Frequency:5.28 GHz (Channel 56) Quality=35/70 Signal level=-75 dBm Encryption key:on ESSID:"NETWORK" Bit Rates:18 Mb/s; 24 MB/s; 36 Mb/s; 48 Mb/s; 54 Mb/s Mode:Master Extra:tsf=0000015977e6102c Extra: Last beacon: 164ms ago IE: WPA Version 1 Group Cipher : TKIP Pairwise Ciphers (2) : TKIP CCMP Authentication Suites (1) : PSK
The main bit to look for is the "IE" line -- note that in this example case, it indicates that the network is using WPA encryption.
Connecting to an Unencrypted Network
This step is usually simple:
$ sudo su $ iwconfig [device] essid [SSID] $ iwconfig [device] mode Managed $ dhclient [device]
The iwconfig command configures wireless devices. The first line above sets the device to associate itself with the network of name "SSID". The second line tells the device to run in managed mode - "node connects to a network composed of many Access Points, with roaming" (see iwconfig(8)). This will work for most situations, and you will likely know/be told if you need a different mode. Finally, the dhclient command attempts to acquire an IP address on the specified device.
Connecting to a WPA/WPA2 Encrypted Network
Using WPA requires the WPA supplicant to be installed. This package is dependent on tftpd-hpa, a TFTP server. However, a different server/program may already be attached to the port that tftpd-hpa needs, preventing it from being installed. The first step is to check whether or not port 69 is free for UDP traffic:
$ netstat -a | grep ftp $ netstat -nlp | grep 69
If some UDP service is indeed bound to port 69 (likely via tftp), we need to disable it so that we can install tftpd-hpa. Keep in mind that if you are PXE booting, it will not work after you disable this service. Our goal is to install tftpd-hpa, and have it running as a daemon and also able to handle PXE requests for us. Moving onward, the netstat commands will likely reveal that inetutils-inetd is the offending service, so disable it:
$ sudo /etc/init.d/inetutils-inetd stop
Then install the WPA supplicant:
$ sudo apt-get update $ sudo apt-get install wpasupplicant
We now need to make sure that our new TFTP server can run, and that we can still PXE boot from this machine:
Firstly, in /etc/default/tftpd-hpa, make sure that RUN_DAEMON="yes" Then in /etc/inetd.conf, find the line:
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot
If you cannot find it, create it. Then, change "udp" to "udp4". This is necessary because otherwise the behavior will default to udp6, for IPv6, which will not allow nodes to boot. Once this has been completed, all that's left is to restart the TFTP server and the inetutils.
$ sudo /etc/init.d/inetutils-inetd restart $ sudo /etc/init.d/tftpd-hpa restart
With that, you are ready to connect to the wireless network. The first step in doing this is to generate a PSK (if you don't know the passphrase, contact your network administrator):
$ mkdir ~/wpa $ wpa_passphrase [SSID] [passphrase] > ~/wpa/SSID.psk
With this PSK generated, you can proceed to connect to the network:
$ sudo su $ iwconfig [device] essid "SSID" $ iwconfig [device] mode Managed $ wpa_supplicant -B -i[device] -c~/wpa/SSID.psk -Dwext $ sleep 3 $ dhclient [device]
Note that you should delay a few seconds after executing the wpa_supplicant command before attempting to acquire an IP address (hence the sleep call). It takes a short amount of time to prepare for a WPA/WPA2 connection to be made, so connecting will fail until this has completed.