pavement

Network, Wireless

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "Here is how to set up a wireless network. This example will demonstrate how to use WPA2-PSK method. ==wpa supplicant== This example shows a non-broadcasted network, and use o...")
 
m (rc.conf: defaultrouter has no _)
 
(12 intermediate revisions by one user not shown)
Line 1: Line 1:
Here is how to set up a wireless network. This example will demonstrate how to use WPA2-PSK method.
+
Here is how to set up a wireless network. This example will demonstrate how to use the WPA2-PSK method.
  
 
==wpa supplicant==
 
==wpa supplicant==
 
This example shows a non-broadcasted network, and use of WPA2 with a preshared key.
 
This example shows a non-broadcasted network, and use of WPA2 with a preshared key.
network section:
+
 
 +
{{file|/etc/wpa_supplicant.conf}}:
 +
ctrl_interface=/var/run/wpa_supplicant
 +
eapol_version=2
 +
ap_scan=1
 
  network={
 
  network={
bssid='gatewaymacaddress'
+
    bssid=''gatewaymacaddress''
ssid="'networkidname'"
+
    ssid="''networkidname''"
scan_ssid=1
+
    bssid=''bssid''
psk="''networkpassword''"
+
    scan_ssid=0
priority=9
+
    psk="''networkpassword''"
proto=RSN
+
    priority=9
key_mgmt=WPA_PSK
+
    proto=RSN
group=CCMP
+
    key_mgmt=WPA_PSK
pairwise=CCMP
+
    group=CCMP
 +
    pairwise=CCMP
 
  }
 
  }
  
RSN signifies WPA2. key_mgmt, group, and pairwise are also common values to use WPA2. Giving the ''ssid'' allows the network to be found when it is hidden from scans.
+
The value of {{code|eapol_version}} depends on your router, so you'll have to test values 0 through 2. For FreeBSD or {{man|wlan|4}}, {{code|ap_scan}} should always be set to 1.
  
Once the network is set up, ''bssid'' can inserted later, it can be found by
+
{{code|scan_ssid}} set to 1 hides the wireless card, while the value of 0 broadcasts its presence. Giving the {{code|ssid}} allows the network to be found, when it is hidden from scans.
 +
 
 +
{{code|RSN}} signifies WPA2. {{code|key_mgmt}}, {{code|group}}, and {{code|pairwise}} are common parameters for wireless protocols.
 +
 
 +
Once the network is set up, {{code|bssid}} can inserted later, it can be found by either
 
  % ifconfig | grep bssid
 
  % ifconfig | grep bssid
 +
% ifconfig wlan0 list scan
  
 
==rc.conf==
 
==rc.conf==
 
  hostname="''mycpomputerhostname''"
 
  hostname="''mycpomputerhostname''"
 
  wlans_''networkcarddriver0''="wlan0"
 
  wlans_''networkcarddriver0''="wlan0"
  default_router="''ipaddress''"  # example 192.168.1.254
+
  defaultrouter="''ipaddress''"  # example 192.168.1.254
  
Set the default network connection, to prevent it from guessing which network to use. Add ''mode'', ''ssid'', and ''bssid'' in the ifconfig line. The values typically match what's in ''wpa_supplicant.conf''.  
+
Set the default network connection, to prevent it from guessing which network to use. Add {{code|mode}}, {{code|ssid}}, and {{code|bssid}} in the {{code|ifconfig}} line. The values typically match what's in {{file|wpa_supplicant.conf}}.  
  
  ifconfig_wlan0="mode ''11g'' ssid ''networkidname'' bssid ''macaddressofnetwork'' WPA DHCP"
+
  ifconfig_wlan0="ssid ''networkidname'' bssid ''macaddressofnetwork'' WPA DHCP"
 
+
''bssid'' or ''mode'' can be found by typing, optionally using ''grep''
+
  
 +
Some settings can be found by typing, optionally using {{cmd|grep}}
 
  % ifconfig | grep mode
 
  % ifconfig | grep mode
  
 
==final steps==
 
==final steps==
 
  % service netif restart
 
  % service netif restart
  % wpa_supplicant -i wlan0
+
  % wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &
 +
% ifconfig
 +
 
 +
[[Category:Configuring FreeBSD]]
 +
[[Category:FreeBSD for Servers]]
 +
[[Category:Important Config Files]]
 +
[[Category:New_User_Tips_and_FAQs]]

Latest revision as of 08:06, 30 May 2018

Here is how to set up a wireless network. This example will demonstrate how to use the WPA2-PSK method.

[edit] wpa supplicant

This example shows a non-broadcasted network, and use of WPA2 with a preshared key.

/etc/wpa_supplicant.conf:

ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
network={
   bssid=gatewaymacaddress
   ssid="networkidname"
   bssid=bssid
   scan_ssid=0
   psk="networkpassword"
   priority=9
   proto=RSN
   key_mgmt=WPA_PSK
   group=CCMP
   pairwise=CCMP
}

The value of eapol_version depends on your router, so you'll have to test values 0 through 2. For FreeBSD or wlan(4), ap_scan should always be set to 1.

scan_ssid set to 1 hides the wireless card, while the value of 0 broadcasts its presence. Giving the ssid allows the network to be found, when it is hidden from scans.

RSN signifies WPA2. key_mgmt, group, and pairwise are common parameters for wireless protocols.

Once the network is set up, bssid can inserted later, it can be found by either

% ifconfig | grep bssid
% ifconfig wlan0 list scan

[edit] rc.conf

hostname="mycpomputerhostname"
wlans_networkcarddriver0="wlan0"
defaultrouter="ipaddress"   # example 192.168.1.254

Set the default network connection, to prevent it from guessing which network to use. Add mode, ssid, and bssid in the ifconfig line. The values typically match what's in wpa_supplicant.conf.

ifconfig_wlan0="ssid networkidname bssid macaddressofnetwork WPA DHCP"

Some settings can be found by typing, optionally using grep

% ifconfig | grep mode

[edit] final steps

% service netif restart
% wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &
% ifconfig
Personal tools