User's Guide

Page6of16
Caterpillar:ConfidentialGreen
2 LINUXWIRELESSCONFIGURATION
2.1 CONNECTTOACCESSPOINT
Thefollowingisanexamplebashscriptthatcanbeusedtoconfigurethewirelessadaptertoconnecttoan
accesspoint.Notethescriptmustbeexecutedwithinashellenvironmentwithrootprivileges.
#!/bin/bash
#Scripttoconfiguremlan_usb0accordingparamtersspecifiedinwpa_supplicant.conffile.
#Bringupwpa_supplicant
/sbin/wpa_supplicant‐dd‐B‐imlan_usb0‐c/etc/wpa_supplicant/wpa_supplicant.conf‐u
#ConfigureIPaddressingviadhclient
dhclient‐nwmlan_usb0
Thefollowingisanexamplesupplicantconfigurationscriptthatistobelocatedinthefollowingdirectory:
/etc/wpa_supplicant.
ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
network={
ssid="wifi2"
scan_ssid=1
psk="Trymeout90210"
key_mgmt=WPA‐PSK
}
2.2 CONFIGUREWIRELESSADAPTERASACCESSPOINT
Thefollowingisabashscriptthatwillconfigurethewirelessadaptertoperformasawirelessaccesspoint.Note
thescriptmustbeexecutedwithinashellenvironmentwithrootprivileges.
#!/bin/bash
ifconfiguap_usb0192.168.1.1
ifconfiguap_usb0netmask255.255.255.0
hostapd‐B‐dd/etc/hostapd/uap_usb0_hostapd.conf
udhcpd/etc/uap_usb0_udhcpd.conf