I have written you a tutorial below on how you can setup your pi as a router. although performance will likely be abysmal(sub 20mbps) because of the amount of encryption required to operate an accesss point and the pi's lack of hardware acceleration for this particular software.
id recommend you start by bringing your os up to date by running the following command:
sudo apt-get update && sudo apt-get upgrade
Then we will begin by installing a program called hostapd, which will be used to setup our wireless access point. We will also need a package called bridge-utils to manage bridge devices.
sudo apt-get install hostapd bridge-utils
We then want to turn off some of the new services that we just installed by running the following command:
sudo systemctl stop hostapd
Next, we will create a bridge br0
using the brctl
command
sudo brctl addbr br0
Then we want to add eth0
(the wired connection) as one of the ports for br0
(bridge 0)
sudo brctl addif br0 eth0
We then can open up your network interfaces file by running the following command:
sudo nano /etc/network/interfaces
and we can add in the following lines:
allow-hotplug wlan0
iface wlan0 inet manual #create a network interface without an ip
auto br0 #makes it start on boot up
iface br0 inet dhcp #automatically assign ip addresses to our clients with dhcp
bridge_ports eth0 wlan0 #bridges our wireless and wired interfaces together
Then, we will configure our wireless access point:
We will start by opening a file named hostapd.conf
which can be located in /etc/hostapd
. We will use the following command to open it:
sudo nano /etc/hostapd/hostapd.conf
We then want to paste the following lines into it:
interface=wlan0 #use the wifi
bridge=br0 # the bridge we set up
ssid=bandzar.com #the router name
hw_mode=g #g = IEEE 802.11g (2.4 GHz)
channel=8 # just a random channel i choose
wmm_enabled=0 #wifi multimedia disabled as your divice is probably too low power
macaddr_acl=0 #disable mac address based auth
auth_algs=1 # 1=wpa, 2=wep, 3=both
ignore_broadcast_ssid=0 #Send empty SSID in beacons and ignore probe request frames that do not
wpa=2 #requires authentication to access
wpa_passphrase=thanksMohammad # the password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
Finally, we can edit the hostapd
file in the /etc/default
directory using the following command:
sudo nano /etc/default/hostapd
and all we want to do is uncomment the following line and add the path to the file we previously edited, so it looks like the following:
DAEMON_CONF="/etc/hostapd/hostapd.conf"
you should now be able to restart and see a wifi access point when you have ethernet plugged in