This just in (my mailbox ;P) ... for OBSD, but perhaps FBSD also?

----- Forwarded message from Yao-Chung-Chang <[EMAIL PROTECTED]> -----

Delivered-To: [EMAIL PROTECTED]
Date: Sun, 2 Sep 2001 04:06:29 +0800 (CST)
From: Yao-Chung-Chang <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re:wicontrol
Precedence: bulk
X-Loop: [EMAIL PROTECTED]

hi

first of all, u didn't point out what mode do u run (adhoc/BSS).BTW,I
have a script for setting up wireless interface at boot up.(all credit
belong to the author )

#  filename: setup_wi0   put it on your /etc , chmod +x setup_wi0
#
#! /bin/sh
set -e

###############################################################################
#
# Configuration variables:

# IFC is the wavelan interface to use (e.g., "wi0"); this must be
# specified:

IFC=wi0

# STATION_NAME is, well, the "station name", which is really only used
# by the WaveLan diagostic tools.  When using the tools (in a remote
# PC -- not this one), the tools will display this name when
# identifying the WaveLan card in this system.  Because it`s only used
# by remote diagnostic tools, it`s not essential to set SYSTEM_NAME.
# However, it is recommended that, if it is set, it be set to be the
# same as the hostname (otherwise, you`ll have to remember which
# station name goes with which hostname).
#
# Note, however, that the following uses `hostname` as the default.
# This may not work if this script is called at bootup (especially
# when called from pccard.conf), because the hostname may not yet have
# been set.  In this case, you should hardcode a value here.

#STATION_NAME=`hostname | sed -e `s/..*$//``
STATION_NAME=`hostname -s | tr "[:lower:]" "[:upper:]"`

# NETWORK_NAME is the name of the network that you wish to join (be a
# part of).  NETWORK_NAME must be set if you wish this system to talk
# to a WaveLan access point.  The NETWORK_NAME can be "ANY"
# (upper-case is required), in which case the card will talk to any
# access point; otherwise, NETWORK_NAME must be set to the same name
# used by the access point.  If you are using "ad-hoc mode" (not using
# an access point), which generally is the case with an home LAN, you
# do not need to set NETWORK_NAME (because ad-hoc mode ignores the
# NETWORK_NAME).

NETWORK_NAME='AC'

# MODE determines how the WaveLan card talks to other cards.  If you
# are using a WaveLan access point, you must set this to "1" (BSS
# mode), and you must also set a valid NETWORK_NAME (above), as the
# NETWORK_NAME must correspond to the name used by the access point.
# For LANs without an access point (the usual case for home LANs),
# MODE should be "3" (ad-hoc mode).
# If you want to connect windoz, u have to set mode=1
# Windoz 2K use ad-hoc again ! shit
#MODE=1                  # 1 --> BSS, 3 --> ad-hoc mode
MODE=3                  # 1 --> BSS, 3 --> ad-hoc mode

# CHANNEL is the frequency channel to use.  The default for cards sold
# in the USA and Europe (except France) is channel 3, 11 in France,
# and 14 in Japan.  Valid channels are:
#
#       USA:                            1-11
#       Europe (except France):         1-13
#       France:                         10-13
#       Japan:                          14 (only -- unchangeable)
#
# See wicontrol(8) for more information.

#CHANNEL=14               # Card default is channel 3
CHANNEL=10               # Card default is channel 3

# KEY is the encryption key to use.  If KEY is blank/empty or not set,
# the encryption key is not set, and encryption will not be enabled.
# If a key is specified here, encryption will be enabled (this script
# does not support enabling/disabling encryption independently of key
# values).  Note that, although the wavelan supports up to four
# different keys (but only one can be used at any one time), only one
# key (key 1) is used here.
#
# Remember that all systems that talk to each other must use the same
# key.
#
# See wicontrol(8) for valid key values.

KEY=

# End of configuration variables.  Nothing should have to be changed
# past this point.
#
###############################################################################

PATH="/usr/sbin:/usr/bin:/sbin:/bin:$PATH"

if [ "X$STATION_NAME" != "X" ]
then
        wicontrol -i $IFC -s "$STATION_NAME"
fi

wicontrol -i $IFC -p $MODE

if [ "X$NETWORK_NAME" != "X" ]
        then
wicontrol -i $IFC -q "$NETWORK_NAME"
wicontrol -i $IFC -n "$NETWORK_NAME"
fi

if [ "X$CHANNEL" != "X" ]
then
        wicontrol -i $IFC -f $CHANNEL
fi

if [ "X$POW" != "X" ]
then
        wicontrol -i $IFC -P $POW
fi

#if [ ( "X$KEY" != "X" ) -a 
#       ( "X$KEY" != "XNO" ) -a 
#       ( "X$KEY" != "Xno" ) -a 
#       ( "X$KEY" != "XNo" ) 
#]
#then
#       wicontrol -i $IFC -k $KEY
#       wicontrol -i $IFC -e 1
#fi
#start up wi0 interface
exit 0

----------------------------- end of file ---->

then modified your hostname.wi* or hostname.xxx    xxx<-wireless interface 


inet 192.168.1.55 255.255.255.0 NONE
!/etc/setup_wi0


                                Regards.
                                                ycchang


----- End forwarded message -----

-- 
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>

Reply via email to