7c98 TL-MR3020 PirateBox - Telecomix Crypto Munitions Bureau

TL-MR3020 PirateBox

From Telecomix Crypto Munitions Bureau

Jump to: navigation, search

Contents

[edit] Credit

The source for this tutorial was copied, pasted, then remixed from the original, found here. on David Darts' wiki. Additional images and details have been added.

[edit] Overview

PirateBox will potentially run on most OpenWrt compatible routers. The following tutorials below are written specifically for the TP-Link MR3020 and the TP-Link 703R. With minor modifications, it is also possible to install PirateBox on a number of other wireless routers capable of supporting the OpenWrt firmware.

[edit] Warning

If you make a mistake and find yourself unable to access your router via telnet or ssh at all, you may think that you've 'bricked' the unit. OpenWRT routers actually have a fail-safe mode you can initiate that allows you to gain entry to the router via a default IP address. Once you've regained access, you can either attempt to correct your mistakes manually or you can execute the -rf /overlay/* command to reset the router entirely (see Recovery section below for details). OpenWRT has a great tutorial for initiating and manipulating the router in fail-safe mode.

[edit] TP-Link MR3020 or WR703N

You can now build a PirateBox with chat for under US$35. Big thanks to Matthias Strubel for porting chat to the OpenWrt version of PirateBox. Thanks also to Christiane Ruetten for developing the original mkPirateBox package and David Morefield for developing the original tutorial for the TP-Link MR3020 build. You can read more about OpenWrt on the TP-Link MR3020 here and OpenWrt on the TP-Link WR703N here. Also check out the PirateBox forum for more info and support. And of course you can read more about the PirateBox project here.

[edit] Stuff You'll Need

  • TP-Link MR3020 (Newegg) or TP-Link TL-WR703N (eBay)
  • USB Flash Drive (formatted FAT32 with a single partition)
  • Ethernet cable

[edit] Pre-Installation

1. First download a copy of OpenWrt for the MR3020 OR for the WR703N

2. Set the toggle switch located beside the LAN/WAN port to WISP mode

3. Connect the router via ethernet cable to your computer and open a web browser to http://192.168.0.254

4. Enter the default username & password (admin & admin)

5. Navigate to System Tools > Firmware Upgrade and select the OpenWRT firmware

6. After the upgrade completes, the system will restart

7. Telnet to the device:

telnet 192.168.1.1

8. Use the passwd command to set your login password - this will enable SSH:

passwd

9. Edit the network file with vi (vi cheat sheet):

vi /etc/config/network

NOTE: You should set the option gateway on line 13 and the list DNS on line 14 to YOUR router's IP address, which should NOT be the same as the IP address to which you're assigning the router (192.168.1.1). For the example below, the gateway router's IP address is set to 192.168.1.11 (modify this to fit your own network configuration). 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'                                                    
        option gateway '192.168.1.11'                                                     
        list dns '192.168.1.11'                                                           
        list dns '8.8.8.8'                                                                
                                                                                          

10. Backup firewall config file:

cp /etc/config/firewall /etc/config/firewall.bak

11. Open the firewall config file:

vi /etc/config/firewall

Modify first 23 lines to look like this. Leave the rest of the file alone.

config defaults                                                                       
        option syn_flood        '1'                                                   
        option input            'ACCEPT'                                              
        option output           'ACCEPT'                                              
        option forward          'ACCEPT'                                              
# Uncomment this line to disable ipv6 rules                                           
#       option disable_ipv6     1                                                     
                                                                                      
config zone                                                                           
        option name             'lan'                                                 
        option network          'lan'                                                 
        option input            'ACCEPT'                                              
        option output           'ACCEPT'                                              
        option forward          'ACCEPT'                                              
                                                                                      
config zone                                                                           
        option name             'wan'                                                 
        option network          'wan'                                                 
        option input            'ACCEPT'                                              
        option output           'ACCEPT'                                              
        option forward          'ACCEPT'                                              
        option masq             '1'                                                   
        option mtu_fix          '1'                      

12. Enable wireless by modifying the wireless config:

vi /etc/config/wireless

Change Line 12 to:

option disabled 0

13. Power cycle the router by unplugging the AC power.

14. Connect the MR3020 to your gateway router (e.g. your home network router) with an ethernet cable and plug the power back in. Wait a couple of minutes until the router boots up. With your computer connected to your home network, try sshing into the router (Note: use the IP address you assigned in step 9):

ssh root@192.168.1.1

15. Ping google to ensure your firewall settings are correct:

ping google.com

16. Add USB support to OpenWrt by installing and enabling the following packages:

opkg update
opkg install kmod-usb-uhci
insmod usbcore
insmod uhci
opkg install kmod-usb-ohci
insmod usb-ohci

[edit] Install PirateBox

Next you'll need to install PirateBox on the router.

1. Connect your USB drive (formatted to FAT32 with only one partition) to the USB port.

2. Install the mkPirateBox package by issuing the following commands. (Note: you can install the non chat version of PirateBox by substituting the 0.2.5_all.ipk package below)

cd /tmp
wget http://piratebox.aod-rpg.de/piratebox_0.3-2_all.ipk
opkg update && opkg install piratebox*

NOTE: To install the "non chat" version of PirateBox, download and install this package instead:

cd /tmp
wget http://cr.23bit.net/piratebox/piratebox_0.2-5_all.ipk 
opkg update && opkg install piratebox*

3. Unplug the ethernet cable and power cycle the device by unplugging the AC power cable for 10 seconds.

4. Restart the device and join the "PirateBox - Share Freely" network. Open any web page and you should be redirected to the PirateBox menu.

5. Begin sharing files and chatting!

[edit] Recovery

You can remove or reinstall OpenWrt/PirateBox using the following procedure:

1. First, access the router via telnet or ssh and delete the "overlay" filesystem with:

rm -rf /overlay/*

2. Now "power cycle" the router by unplugging it and plugging it back in.

3. Next, connect the router's WAN port to the Internet and use the sysupgrade command. NOTE: If PirateBox isn't installed yet, skip the first two commands:

/etc/init.d/piratebox stop
/etc/init.d/piratebox nodns
sysupgrade -n http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin

More info about installing and recovering on the mkPirateBox GitHub page.

[edit] Enclosure and Power

If you're only planning to use the TP-Link router on AC power, you obviously don't need a special enclosure for it to house a battery and USB storage. However, given the router's small size and the fact that it runs on USB power (5V), it naturally lends itself to portability. There are lots of portable 5V power options for this type of device - for something slick and commercially produced, check out the TeckNet iEP380-II Universal USB Battery Pack or this IoGear mobile power station.

Or, if you'd like to assemble something yourself, you might consider this combination:

You might also consider adding a PirateBox sticker - you can download a higher quality PirateBox logo .png file from here. And/or you can order PirateBox stickers from zazzle.


[edit] Buffalo WZR-HP-G300NH

You can find the original tutorial for installing PirateBox (without chat) on the Buffalo WZR-HP-G300NH here. Please note that some users have had difficulty installing OpenWrt on newer versions of the Buffalo WZR-HP-G300NH router featured below. Please see these forum posts (1, 2, 3) for more info.

Personal tools
0