From owner-freebsd-stable@FreeBSD.ORG Tue Feb 1 02:05:58 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB0C9106566B for ; Tue, 1 Feb 2011 02:05:58 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta06.westchester.pa.mail.comcast.net (qmta06.westchester.pa.mail.comcast.net [76.96.62.56]) by mx1.freebsd.org (Postfix) with ESMTP id 727A18FC1A for ; Tue, 1 Feb 2011 02:05:57 +0000 (UTC) Received: from omta16.westchester.pa.mail.comcast.net ([76.96.62.88]) by qmta06.westchester.pa.mail.comcast.net with comcast id 2R2t1g0011uE5Es56S5yt6; Tue, 01 Feb 2011 02:05:58 +0000 Received: from koitsu.dyndns.org ([98.248.34.134]) by omta16.westchester.pa.mail.comcast.net with comcast id 2S5x1g00N2tehsa3cS5yrQ; Tue, 01 Feb 2011 02:05:58 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 27DEB9B427; Mon, 31 Jan 2011 18:05:56 -0800 (PST) Date: Mon, 31 Jan 2011 18:05:56 -0800 From: Jeremy Chadwick To: Yue Wu Message-ID: <20110201020556.GA92331@icarus.home.lan> References: <20110131125729.GA5163@fbsd.t60.cpu> <201101311450.25738.bschmidt@freebsd.org> <20110201015547.GA17910@fbsd.t60.cpu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110201015547.GA17910@fbsd.t60.cpu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-stable@freebsd.org Subject: Re: Error produced by static ip setting: ifconfig: inet: bad value X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2011 02:05:58 -0000 On Tue, Feb 01, 2011 at 09:55:47AM +0800, Yue Wu wrote: > On Mon, Jan 31, 2011 at 02:50:25PM +0100, Bernhard Schmidt wrote: > > On Monday, January 31, 2011 13:57:29 Yue Wu wrote: > > > List, > > > > > > Hi. > > > > > > I use following setting for my wireless networking enviroment: > > > > > > ifconfig_wlan0="mode 11g bssid my:bssid wepmode on weptxkey 1 > > > wepkey 1:0x1111111111 DHCP" > > > > > > But I don't like DHCP and want to use static ip, so I tried: > > > > > > ifconfig_wlan0="mode 11g bssid my:bssid wepmode on weptxkey 1 > > > wepkey 1:0x1111111111 inet 192.168.1.144 netmask 255.255.255.0" > > > > > > But the setting makes BSD networking not working anymore, and when > > > the system starts up, there's an error message: > > > > > > ifconfig: inet: bad value > > > > > > What's wrong? How to use static ip in my wireless networking? > > > > Remove the 'inet', it isn't required. > > > > Thanks Schmidt, I haven't tried with your advice because the issue has > gone after I put the `inet' in front of the value of ifconfig_wlan0, I > will take a note for your hint and try it next time ;p > > p.s., examples in the handbook [1] have the `inet', why? > > [1] http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-wireless.html The advice you were given is incorrect; you should absolutely be specifying the address family (inet). The syntax of the ifconfig(8) line matters -- meaning, you're hitting an intentional design limitation of the parser. You cannot put the "inet x.x.x.x" part at the end. Please see the ifconfig(8) man page. Here's the specific part: ifconfig [-L] [-k] [-m] [-n] interface [create] [address_family] [address [dest_address]] [parameters] address_family = something like "inet", "inet6", etc. address = something like 1.2.3.4 or, or a CIDR address like 1.2.3.4/24 (which would expand to "inet 1.2.3.4 netmask 255.255.255.0") parameters = dependent upon the interface you're configuring. Fore wireless interfaces, you'll need to see the man page section for that. Hope this helps. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP 4BD6C0CB |