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
If you want to enable normal AP mode, you need to disable PirateBox service and enable the normal dnsmasq configuration:
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
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