<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://geralis.ddns.net/cyberwiki/index.php?action=history&amp;feed=atom&amp;title=WiFi_access_point</id>
	<title>WiFi access point - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://geralis.ddns.net/cyberwiki/index.php?action=history&amp;feed=atom&amp;title=WiFi_access_point"/>
	<link rel="alternate" type="text/html" href="https://geralis.ddns.net/cyberwiki/index.php?title=WiFi_access_point&amp;action=history"/>
	<updated>2026-04-03T20:21:43Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in CyberWiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>https://geralis.ddns.net/cyberwiki/index.php?title=WiFi_access_point&amp;diff=15&amp;oldid=prev</id>
		<title>Geli: Die Seite wurde neu angelegt: „==Using your Raspberry Pi as a WiFi access point== https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/  Diese Anleitung funktion…“</title>
		<link rel="alternate" type="text/html" href="https://geralis.ddns.net/cyberwiki/index.php?title=WiFi_access_point&amp;diff=15&amp;oldid=prev"/>
		<updated>2017-03-12T11:42:45Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „==Using your Raspberry Pi as a WiFi access point== https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/  Diese Anleitung funktion…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Using your Raspberry Pi as a WiFi access point==&lt;br /&gt;
https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/&lt;br /&gt;
&lt;br /&gt;
Diese Anleitung funktioniert für alle Raspis mit Debian Jessie (auch mit EDIMAX-Adapter).&lt;br /&gt;
===Packages===&lt;br /&gt;
The first step is to install the required packages:&lt;br /&gt;
 sudo apt-get install dnsmasq hostapd&lt;br /&gt;
I'll go into a little detail about the two:&lt;br /&gt;
* hostapd - This is the package that allows you to use the built in WiFi as an access point&lt;br /&gt;
* dnsmasq - This is a combined DHCP and DNS server that's very easy to configure&lt;br /&gt;
If you want something a little more 'heavyweight', you can use the ''isc-dhcp-server'' and ''bind9'' packages for DHCP and DNS respectively, but for our purposes, ''dnsmasq'' works just fine.&lt;br /&gt;
===Configure your interfaces===&lt;br /&gt;
The first thing you'll need to do is to configure your ''wlan0'' interface with a static IP.&lt;br /&gt;
If you're connected to the Pi via WiFi, connect via ethernet/serial/keyboard first.&amp;lt;br /&amp;gt;&lt;br /&gt;
In newer Raspian versions, interface configuration is handled by ''dhcpcd'' by default. We need to tell it to ignore ''wlan0'', as we will be configuring it with a static IP address elsewhere. So open up the ''dhcpcd'' configuration file with&lt;br /&gt;
 sudo nano /etc/dhcpcd.conf&lt;br /&gt;
and add the following line to the bottom of the file:&lt;br /&gt;
 denyinterfaces wlan0&lt;br /&gt;
Note: This must be ABOVE any ''interface'' lines you may have added!&amp;lt;br /&amp;gt;&lt;br /&gt;
Now we need to configure our static IP. To do this open up the interface configuration file with&lt;br /&gt;
 sudo nano /etc/network/interfaces&lt;br /&gt;
and edit the ''wlan0'' section so that it looks like this:&lt;br /&gt;
 allow-hotplug wlan0&lt;br /&gt;
 iface wlan0 inet static&lt;br /&gt;
     address 172.24.1.1&lt;br /&gt;
     netmask 255.255.255.0&lt;br /&gt;
     network 172.24.1.0&lt;br /&gt;
     broadcast 172.24.1.255&lt;br /&gt;
 #    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf&lt;br /&gt;
Restart ''dhcpcd'' with&lt;br /&gt;
 sudo service dhcpcd restart&lt;br /&gt;
and then reload the configuration for ''wlan0'' with&lt;br /&gt;
 sudo ifdown wlan0; sudo ifup wlan0&lt;br /&gt;
===Configure hostapd===&lt;br /&gt;
Next, we need to configure ''hostapd''. Create a new configuration file with&lt;br /&gt;
 sudo nano /etc/hostapd/hostapd.conf&lt;br /&gt;
with the following contents:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;small&amp;gt;[Auf die Eingabe der Kommentare hinter # kann man verzichten!]&amp;lt;/small&amp;gt;&lt;br /&gt;
 # This is the name of the WiFi interface we configured above&lt;br /&gt;
 interface=wlan0&lt;br /&gt;
 # Use the nl80211 driver with the brcmfmac driver&lt;br /&gt;
 driver=nl80211&lt;br /&gt;
 # This is the name of the network&lt;br /&gt;
 ssid=XXXXXX&lt;br /&gt;
 # Use the 2.4GHz band&lt;br /&gt;
 hw_mode=g&lt;br /&gt;
 # Use channel 6&lt;br /&gt;
 channel=6&lt;br /&gt;
 # Enable 802.11n&lt;br /&gt;
 ieee80211n=1&lt;br /&gt;
 # Enable WMM&lt;br /&gt;
 wmm_enabled=1&lt;br /&gt;
 # Enable 40MHz channels with 20ns guard interval&lt;br /&gt;
 ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]&lt;br /&gt;
 # Accept all MAC addresses&lt;br /&gt;
 macaddr_acl=0&lt;br /&gt;
 # Use WPA authentication&lt;br /&gt;
 auth_algs=1&lt;br /&gt;
 # Require clients to know the network name&lt;br /&gt;
 ignore_broadcast_ssid=0&lt;br /&gt;
 # Use WPA2&lt;br /&gt;
 wpa=2&lt;br /&gt;
 # Use a pre-shared key&lt;br /&gt;
 wpa_key_mgmt=WPA-PSK&lt;br /&gt;
 # The network passphrase&lt;br /&gt;
 wpa_passphrase=xxxxxxxxxx&lt;br /&gt;
 # Use AES, instead of TKIP&lt;br /&gt;
 rsn_pairwise=CCMP&lt;br /&gt;
We can check if it's working at this stage by running&lt;br /&gt;
 sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf&lt;br /&gt;
If it's all gone well thus far, you should be able to see to the&lt;br /&gt;
network XXXXXX! If you try connecting to it, you will see some output from the Pi, but you won't receive and IP address until we set up dnsmasq in the next step. Use Ctrl+C to stop it.&amp;lt;br /&amp;gt;&lt;br /&gt;
We aren't quite done yet, because we also need to tell hostapd where to look for the config file when it starts up on boot. Open up the default configuration file with&lt;br /&gt;
 sudo nano /etc/default/hostapd&lt;br /&gt;
and find the line&lt;br /&gt;
 #DAEMON_CONF=&amp;quot;&amp;quot;&lt;br /&gt;
and replace it with&lt;br /&gt;
 DAEMON_CONF=&amp;quot;/etc/hostapd/hostapd.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Configure dnsmasq===&lt;br /&gt;
The shipped ''dnsmasq'' config file contains a wealth of information on how to use it, but the majority of it is largely redundant for our purposes. I'd advise moving it (rather than deleting it), and creating a new one with&lt;br /&gt;
 sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig&lt;br /&gt;
 sudo nano /etc/dnsmasq.conf&lt;br /&gt;
Paste the following into the new file:&lt;br /&gt;
 interface=wlan0 # Use interface wlan0&lt;br /&gt;
 listen-address=172.24.1.1 # Explicitly specify the address to listen on&lt;br /&gt;
 bind-interfaces # Bind to the interface to make sure we aren't sending things elsewhere&lt;br /&gt;
 server=8.8.8.8 # Forward DNS requests to Google DNS&lt;br /&gt;
 domain-needed # Don't forward short names&lt;br /&gt;
 bogus-priv # Never forward addresses in the non-routed address spaces.&lt;br /&gt;
 dhcp-range=172.24.1.50,172.24.1.150,12h # Assign IP addresses between 172.24.1.50 and 172.24.1.150 with a 12 hour lease time&lt;br /&gt;
===Set up IPv4 forwarding===&lt;br /&gt;
One of the last things that we need to do before we send traffic anywhere is to enable packet forwarding.&lt;br /&gt;
&lt;br /&gt;
To do this, open up the ''sysctl.conf'' file with&lt;br /&gt;
 sudo nano /etc/sysctl.conf&lt;br /&gt;
and remove the # from the beginning of the line containing&lt;br /&gt;
 net.ipv4.ip_forward=1.&lt;br /&gt;
This will enable it on the next reboot, but because we are impatient, activate it immediately with:&lt;br /&gt;
 sudo sh -c &amp;quot;echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&amp;quot;&lt;br /&gt;
We also need to share our Pi's internet connection to our devices connected over WiFi by the configuring a NAT between our ''wlan0'' interface and our ''eth0'' interface. We can do this using the following commands:&lt;br /&gt;
 sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE&lt;br /&gt;
 sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;
 sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT&lt;br /&gt;
However, we need these rules to be applied every time we reboot the Pi, so run&lt;br /&gt;
 sudo sh -c &amp;quot;iptables-save &amp;gt; /etc/iptables.ipv4.nat&amp;quot;&lt;br /&gt;
to save the rules to the file&lt;br /&gt;
 /etc/iptables.ipv4.nat&lt;br /&gt;
Now we need to run this after each reboot, so open the ''rc.local'' file with&lt;br /&gt;
 sudo nano /etc/rc.local&lt;br /&gt;
and just above the line ''exit 0'', add the following line:&lt;br /&gt;
 iptables-restore &amp;lt; /etc/iptables.ipv4.nat&lt;br /&gt;
&lt;br /&gt;
===We're almost there!===&lt;br /&gt;
Now we just need to start our services:&lt;br /&gt;
 sudo service hostapd start&lt;br /&gt;
 sudo service dnsmasq start&lt;br /&gt;
And that's it! You should now be able to connect to the internet through your Pi, via the on-board WiFi!&lt;br /&gt;
To double check we have got everything configured correctly, reboot with&lt;br /&gt;
 sudo reboot&lt;/div&gt;</summary>
		<author><name>Geli</name></author>
	</entry>
</feed>