From owner-freebsd-wireless@FreeBSD.ORG Sat Jun 4 08:04:29 2011 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC311106566B for ; Sat, 4 Jun 2011 08:04:29 +0000 (UTC) (envelope-from sendtomatt@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9E5778FC1A for ; Sat, 4 Jun 2011 08:04:29 +0000 (UTC) Received: by pwj8 with SMTP id 8so1684663pwj.13 for ; Sat, 04 Jun 2011 01:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=iLU3OEdITjI5DZBrHIB/ABEdGgAJFcvDOSn+n4UnOZI=; b=r7JtqxvBoRfL+JDX61C1zUHJTzwr3PM00MHHj2farQC2vR1H2sivBxWGuX6BgOzhQ9 k1OwdqivHDKQqAbVZp6p9h5Ha0F45Ih706pc2YCwyyXcxeUvaGquAjywa4YmSVAuzSm1 cyCjCb7vL0J1RKYW5lhqy/a5vS/IqXdoA/LLg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=c85wJcR4DesF0lBfshG39nHWUUCP+hD86YlJMKc3p0/D79WgyY4FIzt+nSpHOKT8ki +fQTAOEh826aFRuZw6uuwGa3Jf4K/0c4XQtLu9jBTxlYEmdi34yUGR0rFM5ic963HQL4 tWdhwU/9po+FTMlCVNLyE9x85OuSKdr3f1VTk= Received: by 10.142.158.10 with SMTP id g10mr451142wfe.45.1307174668912; Sat, 04 Jun 2011 01:04:28 -0700 (PDT) Received: from sidhe.local ([75.111.37.204]) by mx.google.com with ESMTPS id v6sm1583921wfe.2.2011.06.04.01.04.26 (version=SSLv3 cipher=OTHER); Sat, 04 Jun 2011 01:04:27 -0700 (PDT) Message-ID: <4DE9E709.8010002@gmail.com> Date: Sat, 04 Jun 2011 01:04:25 -0700 From: Matt User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110502 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-wireless@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: wifi connection X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jun 2011 08:04:30 -0000 On 06/03/11 07:19, pál péter wrote: > Hi everyone! > > I have a very silly question. I have an initiated wlan device, and i can > scann the available access points, BUT: > Can anyone write to me those shell commands and there parameters (ifconfig > etc), which need to connect to a scanned access point through the access > point ssid or bssid. I read the following manuals: > ifconfig, vlan, but i did not find the answers. > I need a full command list, eg.: > -connect to a simple access point without encryption. > -connect to an access point with WPA encryption. > -connect to an access point with other encryptions. > -connect to an access point and using DHCP > -connect to an access point which require password. > I need only shell commands, not rc.conf modifications or other options. > Thanks a lot. > _______________________________________________ > freebsd-wireless@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-wireless > To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@freebsd.org" > A. ifconfig up B. ifconfig wlan0 create wlandev C. ifconfig wlan0 up D. If connecting to WPA/WEP/WPA2|CCMP goto E, else continue 1. ifconfig wlan0 ssid 'nameofaccesspoint' 2. dhclient wlan0 3. You should be connected now to the non-encrypted access point nameofaccesspoint; exit 0 :) E. For encrypted access point, setup /etc/wpa_supplicant.conf (type man wpa_supplicant.conf for instructions) F. wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B 1. wait for a bit to allow card to connect 2. dhclient wlan0 3. You are now connected to the highest priority access point in wpa_supplicant.conf which could be contacted. It helps me to make a short shell script to handle these, and you can use dialog command to make it interactive (specific networks, options, static ips instead of dhcp client etc.). If you want static ips, replace the "dhclient wlan0" lines above with: ifconfig wlan0 inet netmask route add default Always make sure you have a sensible /etc/resolv.conf, easy to test...see if you can ping 8.8.8.8 then try www.google.com. If the first one works and the second one fails you don't have working DNS. May the gods of plain text email forgive me if Thunderbird does not preserve my tab-based formatting. Matt