<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Strfry</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Strfry"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Strfry"/>
	<updated>2026-05-05T14:27:22Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Wi-Fi&amp;diff=15231</id>
		<title>Wi-Fi</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Wi-Fi&amp;diff=15231"/>
		<updated>2018-04-02T06:31:02Z</updated>

		<summary type="html">&lt;p&gt;Strfry: Launching udhcpc through wpa_cli actions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes how to set up a wireless network connection with WPA encryption.&lt;br /&gt;
&lt;br /&gt;
== Install necessary drivers and software  ==&lt;br /&gt;
&lt;br /&gt;
First make sure your wireless drivers are loaded properly. (if you are using a &#039;&#039;&#039;Broadcom chipset&#039;&#039;&#039;, see the [[#Broadcom_Wi-Fi_Chipset_Users|section at the bottom of this post]].)&lt;br /&gt;
&lt;br /&gt;
Install {{Pkg|wireless-tools}} and {{Pkg|wpa_supplicant}}.&lt;br /&gt;
{{Cmd|apk add wireless-tools wpa_supplicant}}&lt;br /&gt;
&lt;br /&gt;
== Manual Configuration  ==&lt;br /&gt;
&lt;br /&gt;
Bring the link up so we can look for wireless networks. (An error here means you probably need extra drivers/firmware.)&lt;br /&gt;
{{Cmd|ip link set wlan0 up}}&lt;br /&gt;
&lt;br /&gt;
Find a network to connect to. Look for the ESSID. In this example we will use the ESSID &amp;quot;MyNet&amp;quot;.&lt;br /&gt;
{{Cmd|iwlist wlan0 scanning}}&lt;br /&gt;
&lt;br /&gt;
Configure the wlan0 interface to associate with the MyNet ESSID:&lt;br /&gt;
{{Cmd|iwconfig wlan0 essid MyNet}}&lt;br /&gt;
&lt;br /&gt;
Print its configuration, to check:&lt;br /&gt;
{{Cmd|iwconfig wlan0}}&lt;br /&gt;
&lt;br /&gt;
Create a wpa_supplicant configuration stanza for wpa_supplicant by executing the following:&lt;br /&gt;
{{Cmd|wpa_passphrase MyNet &amp;gt; wpa.conf}}  &lt;br /&gt;
&lt;br /&gt;
wpa_passphrase expects the password to be passed via stdin.  &lt;br /&gt;
&lt;br /&gt;
So, type the password and press ENTER.&lt;br /&gt;
 &lt;br /&gt;
The above commands creates the file {{Path|wpa.conf}} which includes the pre-shared key.  &lt;br /&gt;
&lt;br /&gt;
From one terminal/console, start wpa_supplicant with the generated config:&lt;br /&gt;
{{Cmd|wpa_supplicant -Dwext -iwlan0 -c ./wpa.conf}}&lt;br /&gt;
&lt;br /&gt;
From another terminal/console, start dhcpcd:&lt;br /&gt;
{{Cmd|udhcpc -i wlan0}}&lt;br /&gt;
&lt;br /&gt;
The wlan0 interface should be configured with an IP address at this point:&lt;br /&gt;
{{Cmd|ifconfig wlan0}}&lt;br /&gt;
&lt;br /&gt;
== Automatic Configuration on System Boot  ==&lt;br /&gt;
&lt;br /&gt;
Add an interface stanza for wlan0 to the file {{Path|/etc/network/interfaces}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
auto wlan0&lt;br /&gt;
iface wlan0 inet dhcp&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create {{Path|/etc/wpa_supplicant}} if it doesn&#039;t already exist, set sane permissions and append the configuration {{Path|wpa.conf}} to {{Path|wpa_supplicant.conf}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p /etc/wpa_supplicant&lt;br /&gt;
chmod 750 /etc/wpa_supplicant&lt;br /&gt;
cat wpa.conf &amp;gt;&amp;gt; /etc/wpa_supplicant/wpa_supplicant.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test the automatic interface configuration:&lt;br /&gt;
&lt;br /&gt;
Bring the interface down:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|ifconfig wlan0 down}}&lt;br /&gt;
&lt;br /&gt;
Manually start wpa_supplicant&lt;br /&gt;
&lt;br /&gt;
{{Cmd|/etc/init.d/wpa_supplicant start}}&lt;br /&gt;
&lt;br /&gt;
The wlan0 interface should be associated with the MyNet SSID:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|iwconfig wlan0}}&lt;br /&gt;
&lt;br /&gt;
The wlan0 interface should have been assigned an IP address via DHCP:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|ifconfig wlan0}}&lt;br /&gt;
&lt;br /&gt;
Configure wpa_supplicant to start automatically on boot:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add wpa_supplicant boot}}&lt;br /&gt;
&lt;br /&gt;
Reboot:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|reboot}}&lt;br /&gt;
&lt;br /&gt;
Log in and check that the interface is associated with the access point:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|iwconfig wlan0}}&lt;br /&gt;
&lt;br /&gt;
Check that the interface was assigned an IP address via DHCP:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|ifconfig wlan0 {{!}} grep addr}}&lt;br /&gt;
&lt;br /&gt;
=== Launching udhcpc through wpa_cli actions ===&lt;br /&gt;
&lt;br /&gt;
With the above configuration, udhcpc will only run once at boot.&lt;br /&gt;
If the Wifi isn&#039;t available then, or the network changes in between, it needs to be notified.&lt;br /&gt;
This is done through the wpa_cli action script in /etc/wpa_supplicant/wpa_cli.sh&lt;br /&gt;
&lt;br /&gt;
{{Cmd|rc-update add wpa_cli boot}}&lt;br /&gt;
&lt;br /&gt;
== Broadcom Wi-Fi Chipset Users  ==&lt;br /&gt;
&lt;br /&gt;
The Broadcom chipset is quite popular among older computers. You will need to compile the firmware manually for this chipset as it is not included. &lt;br /&gt;
&lt;br /&gt;
You can check if you have a Broadcom chipset by using dmesg:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|dmesg {{!}} grep Broadcom}}&lt;br /&gt;
&lt;br /&gt;
First install the SDK an Git:&lt;br /&gt;
{{Cmd|apk add alpine-sdk git}}&lt;br /&gt;
&lt;br /&gt;
Then git clone aports from git.alpinelinux.org.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Cmd|git clone git://git.alpinelinux.org/aports}}&lt;br /&gt;
&lt;br /&gt;
Change your directory to &#039;&#039;&#039;aports/non-free/b43-firmware&#039;&#039;&#039;, then build it.&lt;br /&gt;
&lt;br /&gt;
{{Tip|You can&#039;t be root and must be a user of the group abuild (use groupadd f.e. &#039;&#039;&#039;groupadd $(whoami) abuild&#039;&#039;&#039;)}}&lt;br /&gt;
{{Tip|If this is your first time building a package you will need to generate a key for use in signing packages (use &#039;&#039;&#039;abuild-keygen -a -i&#039;&#039;&#039;)}}&lt;br /&gt;
&lt;br /&gt;
{{Cmd|abuild -r}}&lt;br /&gt;
&lt;br /&gt;
Install the generated packge file (it will be in ~/packages/) - make sure to pass &#039;&#039;&#039;--allow-untrusted&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add --allow-untrusted ~/packages/...pkg}}&lt;br /&gt;
&lt;br /&gt;
Now we need fwcutter, which is executed from the firmware package:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|apk add b43-fwcutter b43-firmware}}&lt;br /&gt;
&lt;br /&gt;
Now you need to use modprobe so the device will show up:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|modprobe b43}}&lt;br /&gt;
&lt;br /&gt;
To automate this on startup add it to /etc/modules:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|echo b43 &amp;gt;&amp;gt; /etc/modules}}&lt;br /&gt;
&lt;br /&gt;
Now continue with the normal instructions. &lt;br /&gt;
&lt;br /&gt;
[[Category:Networking]]&lt;/div&gt;</summary>
		<author><name>Strfry</name></author>
	</entry>
</feed>