From charlesreid1

No edit summary
Line 7: Line 7:


=Use etc network interfaces=
=Use etc network interfaces=
NOTE: This method is working on Raspberry Pi platform as of April 2017.
Main Page: [[Linux/Wireless/2]]


To set the wireless network you want a Linux box to join, you can add the network name and passphrase to <code>/etc/network/interfaces</code>. Better yet, you can create one file for each network you want to have ready to go, and swap them in and out by sourcing them or not from the /etc/network/interfaces file.
To set the wireless network you want a Linux box to join, you can add the network name and passphrase to <code>/etc/network/interfaces</code>. Better yet, you can create one file for each network you want to have ready to go, and swap them in and out by sourcing them or not from the /etc/network/interfaces file.
This method is described here: http://charlesreid1.com/wiki/Linux/Wireless/2


First, put the wifi configuration information into a file. This will be called mynetwork.cfg, and will be stored in <code>/etc/network/interfaces.d/mynetwork.cfg</code>.
First, put the wifi configuration information into a file. This will be called mynetwork.cfg, and will be stored in <code>/etc/network/interfaces.d/mynetwork.cfg</code>.

Revision as of 06:08, 15 April 2017

This page covers methods of connecting to wifi from Linux.

The methods break down as follows:

  • Use /etc/network/interfaces
  • Use wpa supplicant
  • How to connect to encrypted vs. unencrypted wifi

Use etc network interfaces

NOTE: This method is working on Raspberry Pi platform as of April 2017.

Main Page: Linux/Wireless/2


To set the wireless network you want a Linux box to join, you can add the network name and passphrase to /etc/network/interfaces. Better yet, you can create one file for each network you want to have ready to go, and swap them in and out by sourcing them or not from the /etc/network/interfaces file.

First, put the wifi configuration information into a file. This will be called mynetwork.cfg, and will be stored in /etc/network/interfaces.d/mynetwork.cfg.

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid NetName
wpa-psk NetPassword

The next step is to reference this configuration file from the /etc/network/interfaces file. Here is what that file looks like:

source /etc/network/interfaces.d/mynetwork.cfg

The /etc/network/interfaces.d/ folder would contain credentials for several networks, and could be swapped out by editing /etc/network/interfaces.

WPA Supplicant Method