<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wireless Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/wireless/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Fri, 01 Feb 2019 10:58:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Building your own Wireless Access Point on top of CentOS7</title>
		<link>https://www.osradar.com/building-your-own-wireless-access-point-on-top-of-centos7/</link>
					<comments>https://www.osradar.com/building-your-own-wireless-access-point-on-top-of-centos7/#comments</comments>
		
		<dc:creator><![CDATA[osradar_editor]]></dc:creator>
		<pubDate>Fri, 01 Feb 2019 10:58:07 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[centos 7]]></category>
		<category><![CDATA[Wireless]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10314</guid>

					<description><![CDATA[<p>Wireless is everywhere, though have you ever thought about building your own wireless access point.?Well, if you&#8217;ve got capable enough wireless NIC and of course bit of understanding in Linux, that&#8217;s what it takes to get the job done.! &#160; On this article, I will stick to CentOS7 system and as well following applications to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/building-your-own-wireless-access-point-on-top-of-centos7/">Building your own Wireless Access Point on top of CentOS7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Wireless is everywhere, though have you ever thought about building your own wireless access point.?Well, if you&#8217;ve got capable enough wireless NIC and of course bit of understanding in Linux, that&#8217;s what it takes to get the job done.!</p>
<p>&nbsp;</p>
<p>On this article, I will stick to CentOS7 system and as well following applications to work on the goal;</p>
<ul>
<li>hostapd =&gt; a daemon that will control how these wireless protocols should behave</li>
<li>dhcpd =&gt; a daemon that taking care of handing over IP address allocation for external clients</li>
<li>FirewallD =&gt; the native firewall daemon on Centos7 platforms that helps to perform NAT functionality while client internet requests traverse via wireless AP.</li>
<li>I also assume that the system that we are gonna build our Access Point has wireless NIC plus another medium of access to reach the internet, for example, having a wired NIC with ISP connectivity.</li>
</ul>
<p>&nbsp;</p>
<p>01. Finding out whether your wireless nic support access-point mode:</p>
<pre class="">iw list</pre>
<p><img loading="lazy" class="alignnone size-medium wp-image-10315" src="https://www.osradar.com/wp-content/uploads/2019/01/1-20-300x267.png" alt="" width="300" height="267" srcset="https://www.osradar.com/wp-content/uploads/2019/01/1-20-300x267.png 300w, https://www.osradar.com/wp-content/uploads/2019/01/1-20.png 398w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>&nbsp;</p>
<p>02. Second, let make sure no blocking behavior occured on our selected wireless NIC.</p>
<pre class="">rfkill list
</pre>
<p><img loading="lazy" class="alignnone size-full wp-image-10317" src="https://www.osradar.com/wp-content/uploads/2019/01/1-21.png" alt="" width="252" height="51" /></p>
<p>As in the figure, both Soft &amp; Hard blocked should say &#8220;no&#8221;, otherwise, the system won&#8217;t allow Hostapd to setup wireless on top of the selected NIC. If unfortunately blocked are in &#8220;yes&#8221;, you can work on following command to mark them as &#8220;no&#8221;</p>
<pre class="">rfkill unblock wlan</pre>
<p>&nbsp;</p>
<p>03. Let install &#8220;epel-release&#8221; package which will then setup a new repository that hosts this &#8220;hostapd&#8221; package.</p>
<pre class="">yum -y install epel-release
</pre>
<pre class="">yum install hostapd dhcp</pre>
<p>&nbsp;</p>
<p>04. Once the installation completes, let&#8217;s move to hostapd specific configuration =&gt; /etc/hostapd/hostapd.conf</p>
<pre class="lang:sh decode:true">ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
driver=nl80211

wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

wpa_passphrase=yourpassword
interface=wlp01
bridge=br-AP
hw_mode=g
channel=6
ssid=CentOSAir</pre>
<p><strong>interface</strong> =&gt; on which interface that setup this wireless access point<br />
<strong>bridge</strong> =&gt; a virtual &#8220;type =&gt; bridge&#8221; interface that manage the IP address space for the hosting access point<br />
<strong>ssid</strong> =&gt; the name that client see as your wireless AP</p>
<p>&nbsp;</p>
<p>05. Next step should be implement a &#8220;br-AP&#8221; virtual bridge interface that we defined while configuring hostapd.</p>
<pre class="">nmcli con add con-name br-AP type bridge ifname br-AP autoconnect yes stp no ip4 192.168.10.1/24</pre>
<p>&nbsp;</p>
<p>06. To let handing over IP address leases over to clients, DHCP is a must =&gt; /etc/dhcpd/dhcpd.conf</p>
<pre class="lang:sh decode:true ">option domain-name-servers 192.168.5.49;
default-lease-time 600;
max-lease-time 7200;
#
# this DHCP server to be declared valid
authoritative;
#
# specify network address and subnet mask
subnet 192.168.10.0 netmask 255.255.255.0 {
       range dynamic-bootp 192.168.10.200 192.168.10.220;
       option broadcast-address 192.168.10.255;
       option domain-name-servers 192.168.10.1;
       option domain-name "example.org";
       option routers 192.168.10.1;
       }</pre>
<p>Note that IP address range should be same on both Bridge interface as well as IP address pool managed by DHCP.</p>
<p>07. While Linux system boots up and yet wireless NIC might not initialized as required. In such cases you might experience a service failure on &#8220;hostapd.service&#8221;. Then the tick should ask the respective initialization unit file to restart the fail service, if found. To do this, you might need to reflect default hostapd.service file to the following context =&gt; vim /etc/systemd/system/hostapd.service</p>
<pre class="lang:sh decode:true">[Unit]
Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
After=network.target

[Service]
Type=forking
PIDFile=/run/hostapd.pid
ExecStart=/usr/sbin/hostapd /etc/hostapd/hostapd.conf -P /run/hostapd.pid -B
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target</pre>
<p>Note following key parameters:<br />
<strong>Restart</strong>=on-failure<br />
<strong>RestartSec</strong>=10</p>
<p>08. Further, I even personally experience a failure in DHCP initialization due to early forking while our Bridge interface hasn&#8217;t completed it&#8217;s own initialization. This is a must because DHCP strictly looking for a system IP address for which it&#8217;s pool of address defined in its configuration. So, lets implement another trick by creating a systemD timer and ask it to fork the dhcpd.service with a bit of delay =&gt; vim /etc/systemd/system/dhcpd.timer</p>
<pre class="lang:sh decode:true ">[Unit]
Description=make dhcp starts after 60sec of boot

[Timer]
OnBootSec=1min
Unit=dhcpd.service

[Install]
WantedBy=multi-user.target</pre>
<p>What this unit does is that, even the main service of &#8220;dhcpd.service&#8221; is in disable mode at startup, this force the initialization of the dhcpd process after 60 seconds of delay.</p>
<p>09. Finally, reload the systemD unit files, stop DHCP service at boot process and finally start DHCP timer as well as hostapd daemon.</p>
<pre class="lang:sh decode:true ">systemctl daemon-reload
systemctl disable dhcpd.service
systemctl enable dhcpd.timer
systemctl enable hostapd.service</pre>
<p>&nbsp;</p>
<p>10. Reboot the system and after 1 minutes of delay, check the status of;</p>
<pre class="lang:sh decode:true ">systemctl status hostapd.service
systemctl status dhcpd.service</pre>
<p>If they are running, then well done, you done it. But, if unfortunately a failure in hostapd.service, try to restart it again by first, disabling WIFI from NetworkManager.</p>
<pre class="">nmcli radio wifi off
</pre>
<p>&nbsp;</p>
<p>11. When external client traffic moving out on via our system&#8217;s public interface(or the NIC which holding your ISP connection), they should subjected to a NAT functionality, otherwise these outgoing traffic  would simply never be route back to our system to complete its communication. To setup the NAT process, lets configure firewallD.</p>
<pre class="lang:sh decode:true ">firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --zone=public --add-masquerade
firewall-cmd --zone=public --add-port=80/tcp
firewall-cmd --zone=public --add-port=443/tcp
firewall-cmd --zone=public --add-service=dns
</pre>
<p>Be mindful to add more rules, if required, to allow certain outgoing tcp/udp protocols.</p>
<p>&nbsp;</p>
<p><em>&#8220;I hope this has been informative for you&#8221;</em></p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/building-your-own-wireless-access-point-on-top-of-centos7/">Building your own Wireless Access Point on top of CentOS7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/building-your-own-wireless-access-point-on-top-of-centos7/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
