Turn PirateBox to Access Point

Posted by Ali 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Ali
Turn PirateBox to Access Point
December 28, 2017 09:55AM
Hi.

I've made a PirateBox with MR3040 and customized OpenWrt image.

My PirateBox itself can connect to Internet. I can ping websites and get their real IP address from PirateBox shell. But the devices that connected to PirateBox can't reach to the Internet.

Is it possible to use PirateBox as an access point? What I mean is sometimes I just want to plug an ethernet cable to my MR3040 and turn that connection to wireless. I don't want to reach piratebox.lan I want to reach the Internet. (I'd be verry happy if both works in the same time but my priority is connecting to Internet).
Re: Turn PirateBox to Access Point
December 29, 2017 04:39PM
Hi,

so you have two issues to

- Switch between AP and PirateBox mode based on the status of the ethernet connection
- Provide Internet Access (and turn of PirateBox).

First of all, you need to change the behavior of the Ethernet port to be used as a WAN port. I a while ago, I wrote a script for that purpose. You can find that one here.
Important: In your case, it might be helpful to enable ssh on the WAN port before rebooting.

The script for enabling the INPUT on the WAN port is

#!/bin/sh            
                                                
wan_num="null"                                  
                                                
for i in 0 1 2 3 ; do                           
   uci_name=$( uci get firewall.@zone[$i].name )
   if [ "$uci_name" = "wan" ] ; then
        wan_num=$i
   fi         
done 
    
if [ "$wan_num" = "null" ] ; then
        echo "ERROR: Could not find WAN zone entry"
        exit 2                
fi                            
                              
echo "Zone number is $wan_num"
 
uci set firewall.@zone[$i].input='ACCEPT'
 
echo "Input for WAN enabled"
echo
echo "Remember to run 'uci commit' after you are done with the configuration"
 
exit 0

If you want to enable normal AP mode, you need to disable PirateBox service and enable the normal dnsmasq configuration:

/etc/init.d/piratebox stop
/etc/init.d/dnsmasq start

If you want to leave PirateBox up and running, you need to modify the PirateBox configuration and some other points, I need to figure out.... because this is usually unsupported.

best regards Matthias