Click here to Skip to main content
11,412,833 members (73,690 online)
Click here to Skip to main content
Technical Blog

Tagged as

Creating a wireless router / access point with #raspberrypi and #raspbian #linux

, 25 May 2014 MIT
Rate this:
Please Sign up or sign in to vote.
What about creating my own low powered development network infrastructure at home? Sounds like a good idea right? You can hack the router settings, creating vlans, control your network traffic, ...Other reason is to create an abstraction layer between your ISP router and your physical network that c


What about creating my own low powered development network infrastructure at home? Sounds like a good idea right? You can hack the router settings, creating vlans, control your network traffic, ...

Other reason is to create an abstraction layer between your ISP router and your physical network that can be moved when you move to your shinny new flat!

Let's get to business then. The router hardware is composed by a raspberry PI model A and a USB WiFi (802.11b/g/n) Module with Antenna for Raspberry. The raspberry was configured to boot from a 4gb USB pen drive with a swap partition and the /tmp size was increased ( instructions ).


My router is using 10.0.0.0/24 network and my internal network 10.10.0.0/24.

First of all install the software:

sudo apt-get install hostapd bind9 isc-dhcp-server ntpdate


This will install AP, DNS, DHCP and NTP support.


Now you need to configure the following files (click on each title to see the configuration!):

interfaces


Configure the network interfaces.

iptables


Configure the firewall, NAT, and forwarding rules.

dhcp


The dhcp server configuration allows the dynamic dns update, meaning that the hostname of the dhcp client is added to the dns.

You can also configure DHCP to only listen to the wireless device,


> sudo vim /etc/default/isc-dhcp-server
INTERFACES="wlan0"


To enable logging, you also need to:

> sudo vim /etc/rsyslog.conf

# add the line

local7.* /var/log/dhcpd.log


dns


Be sure you also run:

# Enable dynamic dns

> sudo chown bind /etc/bind/

hostapd


Enables the wireless access point.

Sync Boot


Lastly you need to disable the services from boot. This is because the raspberry don't have a battery and then it doesn't save the system date which causes DNS and DHCP to fail.

We need to sync the initialisation of the raspberry to first get the date from NTP servers and then initialise the router services.


sudo update-rc.d hostapd remove
sudo update-rc.d bind remove
sudo update-rc.d isc-dhcp-server remove
sudo update-rc.d ntp remove



Now we create the boot script to initialise all:

https://gist.github.com/aetheon/8489749#file-init-router-sh
https://gist.github.com/aetheon/8489749#file-init-d-init-router


sudo update-rc.d init-router defaults
sudo update-rc.d init-router enable


Conclusion


I'm very happy with the raspberry performance. I did not notice any significant decrease on network speed. My next step is to configure vlan support and dynamic dns support to be able to access when I'm away from home.

Also I'll fiddle a little around the iptables rules to have full network control.

If you have any troubles or suggesting you can always contact me.





Visit www.divhide.com for more informations, contacts and news about Web Development.
See other blog posts at blog.divhide.com.



Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.


Feel free to contact divhide.

License

This article, along with any associated source code and files, is licensed under The MIT License

Share

About the Author

aetheon
Web Developer
Portugal Portugal
No Biography provided

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150427.1 | Last Updated 25 May 2014
Article Copyright 2014 by aetheon
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid