Run Arch Raspberry Pi Piratebox over both eth0 and wlan

Posted by srccon 
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
Run Arch Raspberry Pi Piratebox over both eth0 and wlan
July 04, 2016 10:28PM
Is it possible for ethernet and wireless to be going at the same time serving Piratebox content?

The directions that I've found for eth0 enabling are for Rasbian Manual DIY that enables LAN but disables wireless.

Is there a way on the Arch image to have both serving?

Love the project, I use it to distribute class materials.
Re: Run Arch Raspberry Pi Piratebox over both eth0 and wlan
July 05, 2016 08:22PM
Setting the bridge up is pretty difficult. I prepared the configuration files for LibraryBox but never released it.

Maybe you should make a backup of the SDCard before starting!

Technically, you need to do the following steps:

Create bridge interface

Create the following file /etc/netctl/piratebox_bridge
Description="General bridge interface for PirateBox"
Connection=bridge
Interface=br0
BindsToInterfaces=()
ForceConnect=yes
#Enabling DHCP stuff
SkipForwardingDelay=yes

IP=static

Address=(192.168.1.1/24)
IP6=no

Enable that new bridge interface:
sudo netctl enable piratebox_bridge

Next step is to make sure that the ethernet adapter is attached to the bridge. In fact, this could be done much easier (you won't need to have a separate piratebox_bridge config.. you will see later why).

Create the file /etc/netctl/lan_piratebox_bridge
Description="Includes the Ethernet device per default to the PirateBox-Bridge"
Connection=ethernet
Interface=eth0
BindsToInterfaces=(eth0)

ExecUpPost="brctl addif br0 eth0"
ExecDownPre="brctl delif br0 eth0" 

IP=no
IP6=no
SkipNoCarrier=yes

and a backup file to get internet connection again: /etc/netctl/lan_dhcp
Description="Generic profile for lan with DHCP"
Connection=ethernet
Interface=eth0
IP=dhcp
ForceConnect=yes

After that, you need to change the piratebox scripts config:

	cd /opt/piratebox
	sed 's|DO_IFCONFIG="yes"|DO_IFCONFIG="no"|' -i conf/piratebox.conf
	sed 's|USE_DNSMASQ="no"|USE_DNSMASQ="yes"|' -i conf/piratebox.conf
	sed 's|DNSMASQ_INTERFACE="wlan0"|DNSMASQ_INTERFACE="br0"|' -i conf/piratebox.conf
	sed 's|BRIDGE="br-lan"|BRIDGE="br0"|' -i conf/piratebox.conf
	sed 's:NET=192.168.77:NET=192.168.1:'  -i conf/piratebox.conf
        sed 's|DO_BRIDGE="no"|DO_BRIDGE="yes"|' -i conf/piratebox.conf

The following changes will do the following:

* Don't setup the IP on br0
* Bring up dnsmasq listening on br0 interface
* Attach Wifi card to bridge after it is online

Next step is to attach ethernet port to the bridge:

netctl disable lan_dhcp
netctl enable  lan_piratebox_bridge

Now you can attach clients via ethernet cable and they will get an IP from the PirateBox

All changes will be applied after a reboot.


If you want to make internet possible again run the following to commands and perform a reboot:
netctl disable  lan_piratebox_bridge 
netctl enable lan_dhcp



Attention: PirateBox will be available under the IP 192.168.1.1 after that change.

I am guessing it is working like that, at least that is what I can remember.

Let me know if that worked out.

best regards
Matthias


This is only my signature.



Edited 1 time(s). Last edit at 07/06/2016 07:34PM by Matthias.
Re: Run Arch Raspberry Pi Piratebox over both eth0 and wlan
July 06, 2016 09:34AM
Wow! Thanks for taking the time to help me with this.

I'll follow your directions it in the next week and I'll let you know how it turns out.

One quick question, why enable IP6 in the ipv6.conf?
Re: Run Arch Raspberry Pi Piratebox over both eth0 and wlan
July 06, 2016 07:34PM
You are right, the IPv6 enable was a mistake. Please excuse that.
I changed the corresponding part at my Post above.

If that works out, I'll copy that to the wiki.

Matthias
Is this suitable for setting up with a laptop that calls its wireless card eth1? Can I just substitute eth1 for eth0?
Re: Run Arch Raspberry Pi Piratebox over both eth0 and wlan
February 09, 2018 05:42PM
Depends on the wifi driver, if you want to test this, you need to change /boot/wifi_card.conf with the corresponding eth name.