PirateBox - DIY from a PirateBox

1. Pre-Installation

The following tutorial was created on a Mac running OSX 10.8. However, these instructions will also work for Linux or Windows (requires PuTTY).
  1. First download a custom copy of OpenWrt for your device. Images can be found at
    custom Image-Folder (recommended): http://piratebox.lan/install_src/stable.openwrt.piratebox.de/ar71xx_AA/
    or OpenWrt-Src: http://piratebox.lan/install_src/downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/
  2. Windows-User should download Putty for telnet/ssh access: http://piratebox.lan/install_src/putty.exe
  3. Set the toggle switch located beside the LAN/WAN port to WISP mode

Flashing OpenWRT firmware

  1. Turn off your laptop's wireless (in OSX, click on the wifi icon and select "Turn Wi-Fi Off")
  2. Connect the router via ethernet cable to your computer and open a web browser to
  3. Enter the default username & password (admin & admin)
  4. Navigate to
    System Tools > Firmware Upgrade
    and select the OpenWRT firmware
    (Note: The WR703N firmware text is in Chinese. To flash OpenWrt from the web interface, select the last menu item on the left, and then the third submenu item. More info in this Village Telco post).
  5. After the upgrade completes, the system will restart- keep an eye on the LED of your device The webinterface will loop infinitive or will get a 40; so it is not reliable.

Modifing Networksetup & Install Piratebox

  1. Telnet to the device:
    telnet 192.168.1.1
  2. Use the passwd command to set your login password - this will enable SSH:
    passwd
  3. Edit the network & wireless file with vi (vi cheat sheet):
    vi /etc/config/network
  4. The modified file should look like this:
    config interface 'loopback'
            option ifname 'lo'
            option proto 'static'
            option ipaddr '127.0.0.1'
            option netmask '255.0.0.0'
    
    config interface 'lan'
            option ifname 'eth0'
            option type 'bridge'
            option proto 'static'
            option ipaddr '192.168.1.1'
            option netmask '255.255.255.0'
    
    and add
    config interface 'wlan'
          option ifname 'wlan0'
          option proto 'dhcp'
    
  5. Modify Wireless-configuration
    1. Enable Wifi
      vi /etc/config/wireless
      find
          option disabled 1
      
      change it to
          option disabled 0
      
    2. Modify wifi-iface section that it looks like
        config wifi-iface
            option device   radio0
            option network  wlan
            option mode     sta
            option ssid     Install_PirateBox
            option encryption none
      
  6. Modify nameserver-entry
    1. vi /etc/resolv.conf
    2. Exchange
      nameserver 127.0.0.1
      with
    3. nameserver 192.168.2.1 
  7. Reload network configuration:
    /etc/init.d/network reload
  8. Ping piratebox.lan to ensure your firewall settings are correct:
    ping piratebox.lan
  9. Add USB support to OpenWrt by installing and enabling the following packages (Note: this step is not required if you used the customized OpenWrt image from step 1):
  10. Optional, If you are using an image, which is not from the stable.openwrt.piratebox.de folder, to run
    opkg install http://stable.openwrt.piratebox.de/all/packages/pbxopkg_0.0.4_all.ipk
  11. Connect your USB drive (formatted to FAT32 with only one partition) to the USB port.
  12. Install the mkPirateBox package by issuing the following commands.
    opkg update
    opkg install piratebox
  13. If you want to install i.e. imageboard, see below at optional packages

Final steps

AFTER YOU ARE FINISHED
  1. Edit /etc/config/wireless again
    vi /etc/config/wireless
  2. Change
    option mode sta
    option network wlan
    
  3. into
    option mode ap
    option network lan
    option ssid     'PirateBox - Share freely'
    
  4. Once the install is completed, unplug the ethernet cable and disconnect the power for at least 10 seconds.
  5. Restart the device and join the "PirateBox - Share Freely" network. Open any web page and you should be redirected to the PirateBox menu.
  6. Begin sharing files and chatting!

Additional Packages

If you want to install optional packages now, do:
  1. Modify wifi-iface section that it looks like (again, yes)
      config wifi-iface
          option device   radio0
          option network  wlan
          option mode     sta
          option ssid     Install_PirateBox
          option encryption none
    
  2. Reload network configuration:
    /etc/init.d/network reload
    /etc/init.d/piratebox nodns

A . Optional: Install the Kareha Image Board:

  1. Check Date&Time with
    date
  2. Change it, if needed:
    date 2013.06.02-19:00
  3. and now please run
    /opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf install
    /opt/piratebox/bin/install_piratebox.sh /opt/piratebox/conf/piratebox.conf imageboard
  4. Afterwards, edit the Kareha image board config file to change the admin username and password (ADMIN_PASS and SECRET):
    vi /opt/piratebox/www/board/config.pl
  5. Remember doing the final steps before doing a reboot.

B. Optional: Install Mesh-Configuration

  1. Install package
    opkg install piratebox-mesh
  2. Initialize
    /etc/init.d/mesh init
  3. And Enable for startup
    /etc/init.d/mesh enable
  4. Remember doing the final steps before doing a reboot.

C. Optional: Install Forban

  1. Install package
    opkg install piratebox-forban
  2. Forban will startup during next reboot.
  3. If you want to enable automatic download, edit
    /opt/forban/cfg/forban.cfg
    . You have to switch the mode from share to opportunistic.
    vi /opt/forban/cfg/forban.cfg
  4. Remember doing the final steps before doing a reboot.