<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Ubuntu%2FBespin%2FOld%2FWifi_AP_Setup</id>
	<title>Ubuntu/Bespin/Old/Wifi AP Setup - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://charlesreid1.com/w/index.php?action=history&amp;feed=atom&amp;title=Ubuntu%2FBespin%2FOld%2FWifi_AP_Setup"/>
	<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Ubuntu/Bespin/Old/Wifi_AP_Setup&amp;action=history"/>
	<updated>2026-06-20T05:25:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>https://charlesreid1.com/w/index.php?title=Ubuntu/Bespin/Old/Wifi_AP_Setup&amp;diff=28544&amp;oldid=prev</id>
		<title>Unknown user at 05:38, 19 August 2020</title>
		<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Ubuntu/Bespin/Old/Wifi_AP_Setup&amp;diff=28544&amp;oldid=prev"/>
		<updated>2020-08-19T05:38:06Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:38, 19 August 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l319&quot;&gt;Line 319:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 319:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Ubuntu]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Ubuntu]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;LLinux&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Linux&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Bespin]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Bespin]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Wifi]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Wifi]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Hostapd]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Hostapd]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wikidb:diff::1.12:old-28468:rev-28544 --&gt;
&lt;/table&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
	<entry>
		<id>https://charlesreid1.com/w/index.php?title=Ubuntu/Bespin/Old/Wifi_AP_Setup&amp;diff=28468&amp;oldid=prev</id>
		<title>Unknown user: Created page with &quot;In this section we set up Bespin to operate a wifi access point with hostapd. This involves the following:  * Install and configure hostapd * Install and configure dnsmasq * C...&quot;</title>
		<link rel="alternate" type="text/html" href="https://charlesreid1.com/w/index.php?title=Ubuntu/Bespin/Old/Wifi_AP_Setup&amp;diff=28468&amp;oldid=prev"/>
		<updated>2020-08-18T02:46:23Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;In this section we set up Bespin to operate a wifi access point with hostapd. This involves the following:  * Install and configure hostapd * Install and configure dnsmasq * C...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In this section we set up Bespin to operate a wifi access point with hostapd. This involves the following:&lt;br /&gt;
&lt;br /&gt;
* Install and configure hostapd&lt;br /&gt;
* Install and configure dnsmasq&lt;br /&gt;
* Configure access point network interface&lt;br /&gt;
* Start hostapd&lt;br /&gt;
* Create hostapd startup service&lt;br /&gt;
&lt;br /&gt;
==Sysctl Changes==&lt;br /&gt;
&lt;br /&gt;
Enable bespin to forward packets, a necessary role of an access point router, in the sysctl settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/sysctl.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add this line in the .conf file, it should be there but commented out, add it in:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
net.ipv4.ip_forward=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To reload sysctl, run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sysctl --system&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Install hostapd==&lt;br /&gt;
&lt;br /&gt;
Start by installing hostapd:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get -y install hostapd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configure hostapd==&lt;br /&gt;
&lt;br /&gt;
Create the hostapd config file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/hostapd/hostapd.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set this to wlan0 if you are using an ethernet cable&lt;br /&gt;
# to connect your Pi to the internet&lt;br /&gt;
interface=wlan1&lt;br /&gt;
driver=nl80211&lt;br /&gt;
hw_mode=g&lt;br /&gt;
channel=1&lt;br /&gt;
macaddr_acl=0&lt;br /&gt;
ignore_broadcast_ssid=0&lt;br /&gt;
&lt;br /&gt;
# LAN10&lt;br /&gt;
ssid=LAN10&lt;br /&gt;
wpa_passphrase=cow-doctor-horse-building-5&lt;br /&gt;
auth_algs=1&lt;br /&gt;
wpa=3&lt;br /&gt;
wpa_key_mgmt=WPA-PSK&lt;br /&gt;
wpa_pairwise=TKIP&lt;br /&gt;
rsn_pairwise=CCMP&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now set the hostapd configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/default/hostapd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DAEMON_CONF=&amp;quot;/etc/hostapd/hostapd.conf&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point you should be able to start hostapd with this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo hostapd /etc/hostapd/hostapd.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be able to see the wifi network, and clients will be able to authenticate, but they won&amp;#039;t be able to join it because they won&amp;#039;t get IP addresses.&lt;br /&gt;
&lt;br /&gt;
===Side Note: Bridged Network with Shared DHCP===&lt;br /&gt;
&lt;br /&gt;
If you want your AP (wlan1) to share a network with the existing wifi connection (wlan0), and offload the DHCP functionality to the DHCP server of the existing wifi network, you can create a network bridge with hostapd and use the network bridge that hostapd creates (that wlan1 is already attached to) and attach wlan0 to the bridge. This allows clients sending packets to wlan1 to have those packets seen by wlan0.&lt;br /&gt;
&lt;br /&gt;
Modify the following line from the hostapd config file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is already there&lt;br /&gt;
interface=wlan1&lt;br /&gt;
# Add this line&lt;br /&gt;
bridge=br0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here are the steps to bring up the bridge:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ifconfig wlan0 inet 0.0.0.0  # &amp;lt;-- is this necessary???&lt;br /&gt;
sudo brctl addif br0 wlan0&lt;br /&gt;
sudo ifconfig br0 up&lt;br /&gt;
sudo dhclient br0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Breakdown:&lt;br /&gt;
* The bridge already exists, and is already connected to wlan1, so we add the wlan0 device to it&lt;br /&gt;
* We bring up the bridge&lt;br /&gt;
* We ask for an IP address for the bridge device&lt;br /&gt;
&lt;br /&gt;
Here are the steps to bring down the bridge:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo ifconfig br0 down&lt;br /&gt;
sudo brctl delif br0 wlan1&lt;br /&gt;
sudo brctl delif br0 wlan0&lt;br /&gt;
sudo ifconfig br0 down&lt;br /&gt;
sudo dhclient wlan0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Last step is to remove any lines from &amp;lt;code&amp;gt;/etc/dnsmasq.conf&amp;lt;/code&amp;gt; that would hand out IP addresses for this IP space - leave that to the router.&lt;br /&gt;
&lt;br /&gt;
==dnsmasq for DHCP and DNS==&lt;br /&gt;
&lt;br /&gt;
We are going to install dnsmasq to provide a DHCP and DNS service for the AP network. &lt;br /&gt;
&lt;br /&gt;
Start by installing it with apt-get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get -y install dnsmasq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will try to start dnsmasq, but it will fail and print red text. This is fine - the system&amp;#039;s built-in systemd-resolved is already listening on port 53 so we will need to disable this service. (But we need dnsmasq installed FIRST, because disabling systemd-resolved will cause DNS queries to fail, so the internet connection will break. We need dnsmasq ready to start and take over the DNS duties.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo systemctl disable systemd-resolved&lt;br /&gt;
sudo systemctl stop systemd-resolved&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Preserve the original dnsmasq config file, which has a lot of useful information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo mv /etc/dnsmasq.conf{,.orig}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create the dnsmasq config file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/dnsmasq.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interface=wlan1&lt;br /&gt;
dhcp-range=192.168.10.100,192.168.10.150,255.255.255.0,24h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a much better version:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# don&amp;#039;t send external traffic that is missing a domain&lt;br /&gt;
domain-needed&lt;br /&gt;
# don&amp;#039;t send external traffic that has bogus private ip&lt;br /&gt;
bogus-priv&lt;br /&gt;
# set the local domain&lt;br /&gt;
domain=mynet&lt;br /&gt;
local=/mynet/&lt;br /&gt;
# listen on these interfaces and only these interfaces&lt;br /&gt;
listen-address=127.0.0.1&lt;br /&gt;
listen-address=192.168.10.1&lt;br /&gt;
bind-interfaces&lt;br /&gt;
# define range of IP addresses to hand out&lt;br /&gt;
dhcp-range=192.168.10.100,192.168.10.150,255.255.255.0,24h&lt;br /&gt;
# define what to do if no name resolution&lt;br /&gt;
no-resolv&lt;br /&gt;
server=8.8.8.8&lt;br /&gt;
# send dnsmasq logs to a single place&lt;br /&gt;
log-facility=/var/log/dnsmasq.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we are ready to start up dnsmasq:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo systemctl enable dnsmasq&lt;br /&gt;
sudo systemctl start dnsmasq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Set Preferred DNS Nameservers===&lt;br /&gt;
&lt;br /&gt;
Set preferred nameservers by editing the dhcp configuration file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/dhcp/dhcpcd.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static domain_name_servers=8.8.8.8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or for dhclient:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/etc/dhcp/dhclient.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
prepend domain-name-servers 127.0.0.1;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;s&amp;gt;&lt;br /&gt;
(THESE INSTRUCTIONS FROM [[RaspberryPi/Hotspot]] ARE OLD)&lt;br /&gt;
&lt;br /&gt;
Remove the existing file at &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; (a symlink to a network manager thing). Create a new version of the file that specifies preferred nameservers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nameserver 8.8.8.8&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: this file will be overwritten at boot by Network Manager. If your DNS is broken and dnsmasq does not seem to be able to find a preferred nameserver, circle back and double-check that network manager has been disabled.&lt;br /&gt;
&amp;lt;/s&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Improved Logging===&lt;br /&gt;
&lt;br /&gt;
Dnsmasq configuration file has a log-facility option to control where logs go. Add this to the config file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
log-facility=/var/log/dnsmasq.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Testing the AP==&lt;br /&gt;
&lt;br /&gt;
Before testing everything out, do a reboot and make sure that all services are running as expected (dnsmasq in paarticular) and that network interfaces are configured as expected.&lt;br /&gt;
&lt;br /&gt;
To test the AP, we will run hostapd manually first. Checklist for testing if the access point works:&lt;br /&gt;
&lt;br /&gt;
* is dnsmasq service running? (Yes)&lt;br /&gt;
* is hostapd service running? (No)&lt;br /&gt;
* is static ip set for the wifi card creating the AP in /etc/network/interfaces? (Yes, 192.168.10.1)&lt;br /&gt;
* does ifconfig show that IP? (Yes)&lt;br /&gt;
* can cients see to wifi network? (Yes)&lt;br /&gt;
* can clients connect to wifi network? (Yes)&lt;br /&gt;
* does handshake process succeed? (Yes)&lt;br /&gt;
* does client receive an IP? (Yes)&lt;br /&gt;
* can client access internet? (No)&lt;br /&gt;
&lt;br /&gt;
Now run hostapd manually:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo hostapd /etc/hostapd/hostapd.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To add more debug info:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo hostapd -d /etc/hostapd/hostapd.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To log it to a file,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo hostapd -d /etc/hostapd/hostapd.conf 2&amp;gt;&amp;amp;1 | tee hostapd.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From a phone or another computer, connect to the wireless network and verify you get an IP in the lease range specified in the dnsmasq config file.&lt;br /&gt;
&lt;br /&gt;
==Starting the Service==&lt;br /&gt;
&lt;br /&gt;
To start hostap in the background as a service, and enable it to start on boot, run these commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo systemctl unmask hostapd&lt;br /&gt;
sudo systemctl enable hostapd&lt;br /&gt;
sudo systemctl start hostapd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Modifying Startup Service to Retry==&lt;br /&gt;
&lt;br /&gt;
The hostapd service is very fickle, failing the first time it is run but succeeding when run a few seconds later, so we can set up the hostapd service to retry 5 times, waiting 30 seconds each time.&lt;br /&gt;
&lt;br /&gt;
To do that, edit the startup service file at &amp;lt;code&amp;gt;/lib/systemd/system/hostapd.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add these two lines to the &amp;lt;code&amp;gt;[Unit]&amp;lt;/code&amp;gt; section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
StartLimitInterval=200&lt;br /&gt;
StartLimitBurst=5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add these two lines to the &amp;lt;code&amp;gt;[Service]&amp;lt;/code&amp;gt; section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Service]&lt;br /&gt;
Restart=always&lt;br /&gt;
RestartSec=30&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final version of the hostapd startup service is given below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/lib/systemd/system/hostapd.service&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator&lt;br /&gt;
After=network.target&lt;br /&gt;
StartLimitInterval=200&lt;br /&gt;
StartLimitBurst=5&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=forking&lt;br /&gt;
PIDFile=/run/hostapd.pid&lt;br /&gt;
EnvironmentFile=/etc/default/hostapd&lt;br /&gt;
ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}&lt;br /&gt;
Restart=always&lt;br /&gt;
RestartSec=30&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload the service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo systemctl daemon-reload&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart the service:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo service hostapd restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Ubuntu]]&lt;br /&gt;
[[Category:LLinux]]&lt;br /&gt;
[[Category:Bespin]]&lt;br /&gt;
[[Category:Wifi]]&lt;br /&gt;
[[Category:Hostapd]]&lt;/div&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
</feed>