In one of my previous post, I posted about setting up an access point using the Raspberry Pi (post dated Sept 28, 2013). Yes, it was about 8 years ago.
That was my venture into the Raspberry Pi and I did not really use the access point.
However this time, I made an access point for my home automation project so that I could connect devices using the Pi access point and not overload the main router.
This post describes the steps I took (eg. additional software I had to install since I am only using the basic DietPi os) and I hope it helps someone who is trying the set up an access point.
My reference is from a wonderful guide by garyexplains which can be found at https://github.com/garyexplains/examples/blob/master/raspberry_pi_router.md
As I only have one LAN point, I ignored settings for eth1 in the above article.
However my os is Dietpi which can be obtained from https://dietpi.com. I used a headless setup (no GUI) with the OpenSSH server installed.
After I got DietPi installed, I connected it to my router using the LAN cable (eth0).
Using dietpi-config, I set the a static IP for eth0 (leave the wlan as it is for the moment).
My suggestion is to install all the software listed (hostapd, dnsmasq) by garyexplains and stop the services as described.
I then installed dhcp5, iptables:- sudo apt install dhcp5 iptables
I then change the settings as described by garyexplains. For files that are not there, I created them (eg. hostapd.conf).
The rc.local file was not present in my system and I created it to contain the following 2 lines:-
iptables-restore < /etc/iptables.ipv4.nat
exit 0
I then edited the /etc/network/interface file to give wlan a static ip. This ip is like the gateway ip of the router where all network traffic will travel through. The gateway ip would be the ip address of eth0.
After everything is set up, like garyexplains adviced, reboot the Raspberry Pi.
To view ip leases, cat /var/lib/misc/dnsmasq.leases
Good luck.September 28, 2013
Note: I found that the pi can only manage a limited number of connetions (using the on-board wifi). I think it is 7 max (I limit mine to 6).
No comments:
Post a Comment