From owner-freebsd-net@FreeBSD.ORG Mon Nov 28 12:48:25 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD05C16A424 for ; Mon, 28 Nov 2005 12:48:25 +0000 (GMT) (envelope-from keramida@linux.gr) Received: from nic.ach.sch.gr (nic.sch.gr [194.63.238.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CE2A43DA1 for ; Mon, 28 Nov 2005 12:48:06 +0000 (GMT) (envelope-from keramida@linux.gr) Received: (qmail 6138 invoked by uid 207); 28 Nov 2005 12:48:02 -0000 Received: from keramida@linux.gr by nic by uid 201 with qmail-scanner-1.21 (sophie: 3.04/2.30/3.97. Clear:RC:1(81.186.70.128):. Processed in 2.57942 secs); 28 Nov 2005 12:48:02 -0000 Received: from dialup128.ach.sch.gr (HELO flame.pc) ([81.186.70.128]) (envelope-sender ) by nic.sch.gr (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 28 Nov 2005 12:47:59 -0000 Received: from flame.pc (flame [127.0.0.1]) by flame.pc (8.13.4/8.13.4) with ESMTP id jASClLFo001025 for ; Mon, 28 Nov 2005 14:47:21 +0200 (EET) (envelope-from keramida@linux.gr) Received: (from keramida@localhost) by flame.pc (8.13.4/8.13.4/Submit) id jAS90fOr001719; Mon, 28 Nov 2005 11:00:41 +0200 (EET) (envelope-from keramida@linux.gr) Date: Mon, 28 Nov 2005 11:00:41 +0200 From: Giorgos Keramidas To: Imrani Message-ID: <20051128090041.GA1623@flame.pc> References: <20051127135315.GA17605@flame.pc> <20051127161859.96903.qmail@web60022.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051127161859.96903.qmail@web60022.mail.yahoo.com> Cc: freebsd-net@freebsd.org Subject: Re: Configure wireless connection using Cisco aironet 350 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2005 12:48:25 -0000 Please *don't* post a reply on top of the original, quoting the entire original message. Top-posting is a bit annoying and quoting all the text of the original message when it's unnecessary is usually a waste of bandwidth and reader's time. On 2005-11-27 08:18, Imrani wrote: > Giorgos Keramidas wrote: > > Your interface only has an IPv6 address. Is that expected? How > > are you bringing up the an0 interface? > > > > For instance, my /root/netstart-home.sh script contains (among a > > few other things): > > > > # Default setup for my bge0 interface. > > export ifconfig_ath0="DHCP ssid 'XXXX' \ > > wepmode on weptxkey 1 wepkey '1:0xXXXXXXXXXXXXXXXXXXXXXXXXXX'" > > > > /etc/rc.d/netif stop bge0 > > /etc/rc.d/netif stop ath0 > > /etc/rc.d/netif start ath0 > > > > This seems to take care of everything here. > > I don't have any netstart-home.sh under /root directory. Moreover I > dont' want IPv6 and its not something I expect. That's not a "default" script of FreeBSD. It's just a wrapper around /etc/rc.d/netif that I use here, because my wireless connection is not always necessary. I don't want my wireless interface to be brought up automatically *every* time I boot, so I wrote the netstart-home.sh script to fire up the wireless interface only when I need to do so. This works because the /etc/rc.d scripts use /etc/rc.conf as a "persistent storage" of options that they look up in the environment of the current process. This way, by setting things in the current environment, before a script from /etc/rc.d runs (the 'netif' script in this case), I don't have to edit my /etc/rc.conf file manually every time I want to tweak just one option (the ifconfig_ath0 option here). > With regards to bringing up network, problem is network doesn't work > and this is what I did: > > 1) edited /etc/rc.conf and add following line: > ifconfig_an0="DHCP" That's probably ok, if your wireless interface is supposed to obtain an IP address automatically. Then you'll have to run: /etc/rc.d/netif start an0 to let the system startup script 'netif' bring up the interface. This will take care of running 'dhclient an0', which in turn will set up routing, the gateway, the DNS servers and all the other options your /etc/dhclient.conf is configured to use for the 'an0' interface. You didn't use 'netif' though. > 2) Then I run following command: > ifconfig an0 inet 192.168.2.110 netmask 255.255.255.0 wepmode on wepkey 0x00000000000000000000654321 ssid myhome Why? You don't need this. Just use /etc/rc.d/netif as described above to bring up the 'an0' interface with whatever options your /etc/rc.conf specifies (DHCP in this case). You haven't specified any "up" ifconfig option too, so this will set the parameters of the an0 interface but will *NOT* bring it up automatically. This is probably one of the reasons why you're having problems later on. > Once I run this.. ifconfig an0 status shows "associated" but > unfortunately i cannot use this network for any connection. > Even ping 192.168.2.1 doesn't work (thats my router IP). Is the an0 interface "up"? It's very likely that it isn't. > but I get this problem: > > "an0: record length mismatch -- expected 194, got 196 for Rid ff10" > > can u please suggest something? Ok, this sounds like a problem. But before we try to troubleshoot this one, you should use the process I described above to bring the interface up. To summarize: 1. Edit /etc/rc.conf and add: ifconfig_an0="DHCP ssid myhome wepmode on weptxkey 1 wepkey 1:0x00000000000000000000654321" This should be all in one line and you should edit ssid and the wepkey to match your local settings. 2. Bring up the interface using /etc/rc.d/netif: # /etc/rc.d/netif start an0 3. Wait until it's associated: # while true; do status=$( ifconfig an0 2>&1 | grep status: | \ awk '{print $2}' ) if [ "$status" = 'associated' ]; then echo "an0 associated" fi done 4. Check your routing table and the IP address of your an0 interface: # ifconfig an0 # netstat -rn Then, if you are still having problems with the an0 interface, we can start looking for a real bug. - Giorgos