According to Wikipedia, a router is a networking
device that forwards data packets between
computer networks if we tear-down a wireless
router we will probably find an application
specific processor that handles data packets
and an RF segment that handles wireless connectivity.
You know what else has a processor and an
RF segment.
THAT'S RIGHT a raspberry pi model 3 so in
this miniProject we will convert a raspberry
pi to act as a router.
Let's get started.
Let's directly get into the topic, skipping
initial raspberry pi setup.
Please follow getting started with raspberry
pi help guide available on official site to
get your raspberry pi up and running.
First we will update package list available
from repositories using 'sudo apt-get update'
once done we can install these latest packages
using 'sudo apt-get upgrade'.
This might take a while depending on your
internet connection speed.
Next we need to install a user space background
process called hostapd, used for wireless
access points and authentication servers.
We will also need a package called bridge-utils
to manage bridge devices.
We need to turn off some of the new services
that we just installed do it using 'sudo systemctl
stop hostapd'.
Following this we set dhcp background process
not to automatically configure wlan0 and eth0
interfaces.
We do this by putting two lines at the end
of /etc/dhcpcd.conf file.
Next we create a bridge br0 using brctl command
which is an Ethernet bridge administrator
and using this command we add eth0 as one
of the ports for bridge br0.
Now open up a file called interfaces in /etc/network
directory and add these five lines.
First line starts wlan0 interface on a hotplug
event.
Second line creates a network interface without
an IP address which is normally done for bridge
elements.
Third line starts br0 interface on boot up.
Forth line helps in automatic assignment of
IP address to br0 interface using DHCP server
and finally fifth line connects eth0 interface
with wlan0.
Save this file and close it.
Next we will configure our wireless access
point, we can do this using a file called
hostapd.conf in /etc/hostapd folder.
Open it up and paste these lines.
Value assigned to ssid is the name that access
point will use to broadcast its existence.
Last five lines are focused on authentication
and security of access point.
Value of wpa_passsphrase is used as login
password which is subscribe in our case.
These is a link to document in description
where you can find definition of each variable
that we have used here.
Finally open up hostapd file in /etc/default
directory uncomment DAEMON_CONF line and provide
path to file we just created.
This completes setup for raspberry pi to act
as router. So.
So that's it for this miniproject and you
know what to do right.wpa_passphrase.
