Difference between revisions of "APF/OPOS as Wi-Fi Access Point"
From ArmadeusWiki
(→Configuration) |
m (JulienB moved page APF as Wi-Fi Access Point to APF/OPOS as Wi-Fi Access Point: OPOS can do it too ;-)) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{ | + | {{Note|Following instructions have only be tested on [[APF6]] and [[OPOS6UL]]/[[OPOS6UL_NANO]]}} |
==Installation== | ==Installation== | ||
− | * You will need hostapd (installed by default on [[APF6]]): | + | * You will need ''hostapd'' (installed by default on [[APF6]] & [[OPOS6UL]]/[[OPOS6UL_NANO]]). If not installed: |
<pre class="host"> | <pre class="host"> | ||
$ make menuconfig | $ make menuconfig | ||
Line 14: | Line 14: | ||
[ ] Enable WPS | [ ] Enable WPS | ||
</pre> | </pre> | ||
+ | * then, reflash your rootfs or rsync it, if your board has SSH access through Ethernet port. | ||
==Configuration== | ==Configuration== | ||
Line 23: | Line 24: | ||
<pre class="apf"> | <pre class="apf"> | ||
# mkdir -p /etc/hostapd/ | # mkdir -p /etc/hostapd/ | ||
+ | |||
# cat > /etc/hostapd/hostapd.conf <<EOF | # cat > /etc/hostapd/hostapd.conf <<EOF | ||
interface=wlan0 | interface=wlan0 | ||
− | ssid= | + | ctrl_interface=/var/run/hostapd |
+ | ssid=OPOSSOM | ||
hw_mode=g | hw_mode=g | ||
channel=6 | channel=6 | ||
#auth_algs=1 | #auth_algs=1 | ||
wpa=2 | wpa=2 | ||
+ | wpa_key_mgmt=WPA-PSK | ||
+ | rsn_pairwise=CCMP | ||
wpa_passphrase=YOUHOULESBILOUS | wpa_passphrase=YOUHOULESBILOUS | ||
− | |||
EOF | EOF | ||
Line 42: | Line 46: | ||
# hostapd -B /etc/hostapd/hostapd.conf | # hostapd -B /etc/hostapd/hostapd.conf | ||
</pre> | </pre> | ||
− | * If the devices connecting to your Access Point require dynamic IP | + | * If the devices connecting to your Access Point require dynamic IP address allocation, you will need to install a [[DHCP server]] on your APF/OPOS too. |
+ | |||
+ | ==AP+STA mode== | ||
+ | * It is also possible to configure your module to act as a Wi-Fi client/station (STA), and in the same time offer AP (Access Point) services. | ||
+ | * For this you have to create virtual network interface (here ''uap0'') and use it instead of ''wlan0'' for AP stuff configuration (''hostapd'' and ''dnsmasq''): | ||
+ | <pre class="apf"> | ||
+ | # iw dev wlan0 interface add uap0 type __ap | ||
+ | |||
+ | # ifconfig uap0 192.168.10.1 | ||
+ | </pre> | ||
+ | * So after this you have: | ||
+ | ** a Wi-Fi interface ''wlan0'' for station(STA)/client mode usable with for example [[WPA supplicant]] | ||
+ | ** and a Wi-Fi interface ''uap0'' for access point(AP) mode, usable with previous instructions on this page. | ||
+ | |||
+ | ==Control== | ||
+ | * When launched, you can control hostapd daemon with corresponding command line tool: | ||
+ | <pre class="apf"> | ||
+ | # hostapd_cli | ||
+ | </pre> | ||
+ | |||
+ | ==Links== | ||
+ | * https://wiki.gentoo.org/wiki/Hostapd | ||
[[Category:Wireless]] | [[Category:Wireless]] | ||
+ | [[Category:Network]] |
Latest revision as of 16:38, 12 February 2021
Note: Following instructions have only be tested on APF6 and OPOS6UL/OPOS6UL_NANO |
Installation
- You will need hostapd (installed by default on APF6 & OPOS6UL/OPOS6UL_NANO). If not installed:
$ make menuconfig
Target packages ---> Networking applications ---> [*] hostapd [ ] Enable EAP [ ] Enable WPS
- then, reflash your rootfs or rsync it, if your board has SSH access through Ethernet port.
Configuration
- Bring up your Wi-Fi interface and give it an address (here 192.168.2.1):
# ifconfig wlan0 up 192.168.2.1 netmask 255.255.255.0
- Create /etc/hostapd/ directory and put it this hostapd.conf configuration file:
# mkdir -p /etc/hostapd/ # cat > /etc/hostapd/hostapd.conf <<EOF interface=wlan0 ctrl_interface=/var/run/hostapd ssid=OPOSSOM hw_mode=g channel=6 #auth_algs=1 wpa=2 wpa_key_mgmt=WPA-PSK rsn_pairwise=CCMP wpa_passphrase=YOUHOULESBILOUS EOF
- here we used fixed channel (6) (as some drivers can't allow hostapd to find less occupied channel through scanning)
- security is WPA2-PSK. To have "Open" Access Point uncomment #auth_algs=1 and comment 3 wpa lines
- Launch hostapd:
# hostapd -B /etc/hostapd/hostapd.conf
- If the devices connecting to your Access Point require dynamic IP address allocation, you will need to install a DHCP server on your APF/OPOS too.
AP+STA mode
- It is also possible to configure your module to act as a Wi-Fi client/station (STA), and in the same time offer AP (Access Point) services.
- For this you have to create virtual network interface (here uap0) and use it instead of wlan0 for AP stuff configuration (hostapd and dnsmasq):
# iw dev wlan0 interface add uap0 type __ap # ifconfig uap0 192.168.10.1
- So after this you have:
- a Wi-Fi interface wlan0 for station(STA)/client mode usable with for example WPA supplicant
- and a Wi-Fi interface uap0 for access point(AP) mode, usable with previous instructions on this page.
Control
- When launched, you can control hostapd daemon with corresponding command line tool:
# hostapd_cli