Difference between revisions of "Access Point"

From Klaus' wiki
Jump to: navigation, search
(Manually test)
Line 3: Line 3:
 
I have done this with a TP-Link TL-WN722N adapter. [[File:TP-Link TL-WN722N.png|100px|right]]
 
I have done this with a TP-Link TL-WN722N adapter. [[File:TP-Link TL-WN722N.png|100px|right]]
  
==Configure the Hostappd==
+
==Manual set up for testing==
 +
First is introduced a manual setup and test. After that comes the automation
 +
 
 +
===Configure the Hostappd===
  
 
First edit the /etc/hostapd/hostapd.conf file (as root)
 
First edit the /etc/hostapd/hostapd.conf file (as root)
Line 41: Line 44:
 
  ctrl_interface_group=0
 
  ctrl_interface_group=0
  
==Configure IP addresses==
+
===Configure IP addresses===
  
 
To set an ip address on the wlan0 interface perform these commands as root:
 
To set an ip address on the wlan0 interface perform these commands as root:
Line 51: Line 54:
 
</source>
 
</source>
  
==Set up dnsmasqd==
+
===Set up dnsmasqd===
 
In /etc/dnsmasq.d/ create a file (e.g. WlanAp0) with this content:
 
In /etc/dnsmasq.d/ create a file (e.g. WlanAp0) with this content:
 
  interface=wlan0
 
  interface=wlan0
Line 60: Line 63:
 
Note: Do not add to the SoftAp0 file because it will be overwritten at boot.
 
Note: Do not add to the SoftAp0 file because it will be overwritten at boot.
  
==Manually test==
+
===Manually test===
  
 
Next test i manually, in order to see if the access point software will run without errors.
 
Next test i manually, in order to see if the access point software will run without errors.
Line 76: Line 79:
 
</source>
 
</source>
  
==Enable DCHP server==
+
==Automating it all==
Next thing is to enable a dhcp server.
+
 
+
 
+
---more to come, when I get the spare time---
+

Revision as of 16:37, 12 November 2020

In order to setup the BeagleBone Black as an access point you need to go through a few steps.

I have done this with a TP-Link TL-WN722N adapter.
TP-Link TL-WN722N.png

Manual set up for testing

First is introduced a manual setup and test. After that comes the automation

Configure the Hostappd

First edit the /etc/hostapd/hostapd.conf file (as root)

### Wireless network name ###
#
### Set your bridge name ###
#bridge=br0
#driver
driver=nl80211
country_code=DK
ssid=<The SSID the AP should Present it self with>
channel=<select af free channel e.g. 1, 6 or 11>
hw_mode=g
interface=wlan0
# # Static WPA2 key configuration
# #1=wpa1, 2=wpa2, 3=both
wpa=2
wpa_passphrase=<YourDesiredVerySecretPassword>
## Key management algorithms ##
wpa_key_mgmt=WPA-PSK
#
## Set cipher suites (encryption algorithms) ##
## TKIP = Temporal Key Integrity Protocol
## CCMP = AES in Counter mode with CBC-MAC
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
#
## Shared Key Authentication ##
auth_algs=1
## Accept all MAC address ###
macaddr_acl=0
#enables/disables broadcasting the ssid
ignore_broadcast_ssid=0
# Needed for Windows clients
eapol_key_index_workaround=0
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

Configure IP addresses

To set an ip address on the wlan0 interface perform these commands as root:

]$ ip link set wlan0 down
]$ ip addr flush dev wlan0
]$ ip link set wlan0 up
]$ ip addr add 192.168.22.1/24 dev wlan0

Set up dnsmasqd

In /etc/dnsmasq.d/ create a file (e.g. WlanAp0) with this content:

interface=wlan0
dhcp-range=wlan0,192.168.22.2,192.168.22.12,2h
dhcp-option=wlan0,3
dhcp-option=wlan0,6

Note: Do not add to the SoftAp0 file because it will be overwritten at boot.

Manually test

Next test i manually, in order to see if the access point software will run without errors.

root@beaglebone ]$ systemctl stop wpa_supplicant.service
root@beaglebone ]$ hostapd  /etc/hostapd/hostapd.conf

If you can get this connection up running with your password but no IP address everything at this point is fine.

You can stop the wpa_supplicant service permanently by issuing

root@beaglebone ]$ systemctl disable wpa_supplicant.service

Automating it all