Create a WiFi Access Point for remote access that needs no internet connection [raspberrypi]

this tutorial uses the Edimax “EW-7811UN” wireless adapter

based on:
https://ariandy1.wordpress.com/2013/04/07/setting-up-wifi-access-point-with-edimax-ew-7811un-on-raspberry-pi/

maybe also intresting:
http://www.forum-raspberrypi.de/Thread-tutorial-raspberry-pi-accesspoint-mit-lokalem-webserver-betreiben

useage:
-you can use it everywhere for example in the woods
(cause the pi does not need to be connect to internet
you can just connect to the wifi-access-point and then connect to it over ssh)

expand the fresh raspbian sd card to full size:
sudo raspi-config
->expand to full size ->restart

update the paketlist:
sudo apt-get update

edit the interfaces file and uncomment everything with wlan0 and paste at the end the following:
sudo nano /etc/network/interfaces

iface wlan0 inet static
address 10.0.0.1
network 10.0.0.0
netmask 255.255.255.0
broadcast 10.0.0.255

edit /etc/rc.local and add before exit0:
sudo nano /etc/rc.local
ifup wlan0

install dnsmasq:
sudo apt-get -y install dnsmasq

run the following commands:
sudo service dnsmasq stop
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
sudo touch /etc/dnsmasq.conf

edit the dnsmasq.conf file and paste the following code:
sudo nano /etc/dnsmasq.conf

interface=wlan0
expand-hosts
domain=local
dhcp-range=10.0.0.10,10.0.0.20,24h
dhcp-option=3,10.0.0.1

edit the hosts file and add at the end of it the following code:
sudo nano /etc/hosts

10.0.0.1        raspi raspberrypi raspi.local raspberrypi.local

install the folling things:
sudo apt-get install bridge-utils hostapd -y

now run the following commands:
wget http://www.daveconroy.com/wp3/wp-content/uploads/2013/07/hostapd.zip
unzip hostapd.zip
sudo mv /usr/sbin/hostapd /usr/sbin/hostapd.bak
sudo mv hostapd /usr/sbin/hostapd.edimax
sudo ln -sf /usr/sbin/hostapd.edimax /usr/sbin/hostapd
sudo chown root.root /usr/sbin/hostapd
sudo chmod 755 /usr/sbin/hostapd

edit the file /etc/hostapd/hostapd.conf:
(and maybe change the default password and default ssid)
sudo nano /etc/hostapd/hostapd.conf

interface=wlan0
driver=rtl871xdrv
bridge=br0
ssid=WlanAccessPi
channel=1
wmm_enabled=0
wpa=1
wpa_passphrase=YourSecurePassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0

edit the /etc/default/hostapd file:
sudo nano /etc/default/hostapd
change the following line and do NOT forget to remove the # infront!!!!!:
#DAEMON_CONF=""
to:
DAEMON_CONF="/etc/hostapd/hostapd.conf"

run the following commands:
sudo update-rc.d hostapd enable
sudo reboot

connect with android phone to wlan WlanAccessPi with password YourSecurePassword -> connected
connect over ssh with android phone to 10.0.0.1 port 22 user pi password raspberry ->works

disconnect lan cable from pi

connect over ssh with android phone to 10.0.0.1 port 22 user pi password raspberry ->reboot

connect with windows pc to wlan WlanAccessPi with password YourSecurePassword -> connected
connect with windows pc with putty over ssh to 10.0.0.1 port 22 user pi password raspberry ->works

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s