Commits

satanowski committed 036a509

network configuration

Comments (0)

Files changed (5)

 
    music_directory     "/media"
    auto_update    "yes"
+
+
+
+-----------------
+WiFi Access Point
+-----------------
+First install the required software:
+
+:: 
+
+   apt-get install hostapd dnsmasq
+
+then create/edit the */etc/hostapd/hostapd.conf* file:
+
+::
+
+   interface=wlan0
+   driver=nl80211
+   ssid=drsMalina
+   channel=7
+   hw_mode=g
+
+   auth_algs=1
+   wpa=3
+   wpa_passphrase=veryStrongPassword
+   wpa_key_mgmt=WPA-PSK
+   wpa_pairwise=TKIP CCMP
+   rsn_pairwise=CCMP
+
+   macaddr_acl=0
+   ignore_broadcast_ssid=0
+
+
+Next, configure the dhcp server (*/etc/dnsmasq.conf*):
+
+::
+
+   interface=wlan0
+   dhcp-range=192.168.1.2,192.168.1.50,12h
+
+
+Set the ip of the new network interface (*/etc/network/interfaces*)
+
+::
+
+   allow-hotplug wlan0
+   auto wlan0
+   iface wlan0 inet static
+        address 192.168.1.1
+        broadcast 192.168.1.255
+
+
+Restart the dhcp server:
+
+::
+
+   /etc/init.d/dnsmasq restart
+
+
+and run the access point:
+
+::
+
+   hostapd -d /etc/hostapd/hostapd.conf
+interface=wlan0
+dhcp-range=192.168.1.2,192.168.1.50,12h

etc/hostapd/hostapd.conf

+interface=wlan0
+driver=nl80211
+ssid=drsMalina
+channel=7
+hw_mode=g
+
+auth_algs=1
+wpa=3
+wpa_passphrase=veryStrongPassword
+wpa_key_mgmt=WPA-PSK
+wpa_pairwise=TKIP CCMP
+rsn_pairwise=CCMP
+
+macaddr_acl=0
+ignore_broadcast_ssid=0

etc/network/interfaces

+allow-hotplug wlan0
+auto wlan0
+iface wlan0 inet static
+	address 192.168.1.1
+	broadcast 192.168.1.255
+#!/bin/sh -e
+#
+# rc.local
+#
+# This script is executed at the end of each multiuser runlevel.
+# Make sure that the script will "exit 0" on success or any other
+# value on error.
+#
+# In order to enable or disable this script just change the execution
+# bits.
+#
+# By default this script does nothing.
+
+# Print the IP address
+_IP=$(hostname -I) || true
+if [ "$_IP" ]; then
+  printf "My IP address is %s\n" "$_IP"
+fi
+
+# Check if wlan0 exists and run access point
+RR=$(cat /proc/net/dev | grep wlan0 | wc -l)
+if [[ $RR -ge 1]]
+then
+	ifconfig wlan0 192.168.1.1 netmask 255.255.255.0
+	hostapd -B /etc/hostapd/hostapd.conf
+fi
+
+exit 0
+