Setting up Bluetooth Personal Area Networking on Whiite-Linux ============================================================= Requirements: * A wii, with whiite-linux installed. * A BNEP-enabled whiite-linux kernel. * Another Linux-based computer with a bluetooth adapter (and drivers) installed In this example, we'll be setting up a Bluetooth Personal Area Network on the subnet 192.168.5.0/24, with the computer as 192.168.5.1 and the Wii as 192.168.5.2. Change this as appropriate. We also assume your computer is running default iptables settings, that allow all, and that you don't have any other special routing rules inserted. We also assume that your main network interface on your computer is eth0. If you are having problems, reboot the Wii. The bluetooth stack is very weird sometimes, and a reboot is the only way to fix it. Bluetooth PAN runs at about 50kB/s, and has latency of around 70-120ms. If you are doing large file transfers, USB storage devices will be much faster. You should keep the bluetooth adapter and the Wii in close proximity (ideally in the same room) for best performance. Do not: * Change the device class of the Wii. It should be 0x3e0100. * Setup an ethernet bridge on the computer between it's network interface and the bluetooth PAN interface. It doesn't work. * Attempt to use internet protocols other than IPv4 over the PAN. Step 1: Setup the Bluetooth PAN host ==================================== * Open a root terminal on the computer. * Make sure bluetooth is working properly, and your bluetooth adapter has been detected. Use `hcitool dev` to show your bluetooth adapter details. * Copy down the MAC address of your bluetooth device. * Run `pand -s -M --role=NAP` Step 2: Connect the Wii to the Bluetooth PAN ============================================ * Run `pand --role=PANU -c XX:XX:XX:XX:XX:XX --persist --encrypt`, where XX:XX:XX:XX:XX:XX is your computer's bluetooth MAC address. * Instead of entering the MAC address explicitly, you can use --search (instead of -c) to automatically attempt to find your computer. However, this doesn't always work, particularly when there are other bluetooth devices nearby. You can use `hcitool scan` to show other Bluetooth devices in range. * If you get the error "Unable to open control socket: Protocol not supported", you do not have a BNEP enabled kernel. You can verify this by typing `zgrep BNEP /proc/config.gz`. If it returns "CONFIG_BT_BNEP=y", then you have a BNEP-enabled kernel. If it returns "# CONFIG_BT_BNEP is not set", then you do not. * At this point, the computer should prompt you to enter your PIN for the Wii. Enter the PIN "1234" (as this is the PIN it will try to use). * Verify that the bnep0 interface is available. It will only be available if the system was successfully connected. To do this, run `ifconfig bnep0`. * Assign an IP address to the Wii. `ifconfig bnep0 192.168.5.2` Step 3: Setup IP and masquerading on the computer ================================================= * Assign an IP address to the computer. `ifconfig bnep0 192.168.5.1` * Create the NAT. `iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE` * Enabled IP forwarding. `echo 1 > /proc/sys/net/ipv4/ip_forward` * Ping the Wii to verify connection. `ping -c4 192.168.5.2` Step 4: Setup routing on the Wii ================================ * Set the default gateway. `route add default gw 192.168.5.1` * Set the DNS servers. Edit /etc/resolv.conf as normal here. You should use the same settings as are on your computer - as we have not configured a DNS server on your computer (unless you already have one, then feel free to use it). * Ping the computer to verify connection. `ping -c4 192.168.5.2` * Ping google to verify DNS and internet connectivity are available. `ping -c4 www.google.com` You now have an internet connection on your Wii! Extra Step: Connecting to the Wii from other computers on your LAN ================================================================== As you cannot use ethernet bridging between an ethernet adapter and bluetooth, everything has to be routed on an IP layer. If you want to access the Wii from another computer on your LAN, you would enter: `route add -host 192.168.5.2 gw 192.168.1.3` Where 192.168.1.3 is the LAN address of the computer with the bluetooth dongle. You will then be able to SSH to the Wii as per normal.