From owner-freebsd-doc Mon Apr 8 13:21:59 2002 Delivered-To: freebsd-doc@freebsd.org Received: from cumin.apnic.net (cumin.apnic.net [202.12.29.59]) by hub.freebsd.org (Postfix) with ESMTP id 19E7F37B416; Mon, 8 Apr 2002 13:21:46 -0700 (PDT) Received: from durian.apnic.net (durian.apnic.net [202.12.29.252]) by cumin.apnic.net (8.12.1/8.12.1) with ESMTP id g38KLhHa020466; Tue, 9 Apr 2002 06:21:44 +1000 Received: (from ggm@localhost) by durian.apnic.net (8.11.6/8.11.6) id g38KLhO32116; Tue, 9 Apr 2002 06:21:43 +1000 Date: Tue, 9 Apr 2002 06:21:43 +1000 From: George Michaelson Message-Id: <200204082021.g38KLhO32116@durian.apnic.net> To: freebsd-doc@freebsd.org Subject: rc.conf, pccard_ether and ifconfig_ Cc: freebsd-questions@freebsd.org X-Scanned-By: MIMEDefang 2.1 (www dot roaringpenguin dot com slash mimedefang) Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I just worked out how to get my an0 802.11 card working properly across reboot and sleep mode. I couldn't find any documentation on it, so here is a chunk of text which a FreeBSD wordsmith might find tunable into real english. I've mailed freebsd-questions as well, so its in the target for keyword searches in the mailing list if people are having problems cheers -George If you have removable network media (eg a pccard 802.11 device) there is a very good chance it needs pre-configuration before ifconfig and DHCP can complete. typically this is to set radio level behaviour, or tune media-specific settings. To get this working, you may need to add a couple of options to rc.conf and also create a suitable start_if (and possibly stop_if) file. 1) enable removable_interfaces in rc.conf set removable_interfaces to the list of devices which may be enabled or disabled by card insertion/removal. eg for a Cisco 340/350 series 802.11 card: removable_interfaces="an0" this is used by pccard_ether make sure pccard.conf (either in /etc or /etc/defaults) is calling pccard_ether for your card insert/remove events. 2) set the network config, or enable DHCP if required ifconfig_an0="DHCP" 3) write the pre-configuration script as start_if. and stop_if. eg for the Cisco card, ancontrol has to be used to set the SSID, WEP mode etc. its a good idea to set variables like the WEP status in rc.conf and copy the normal rc file inclusion method to parameterize this activity. a simple example might be: #!/bin/sh # Suck in the configuration variables # if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf source_rc_confs elif [ -r /etc/rc.conf ]; then . /etc/rc.conf fi ################# # $wifi_ssid_1, $wifi_ssid_2, $wifi_ssid_3, # $wifi_wep_enable and $wifi_wep_key # need to be set in rc.conf ################# ancontrol -i an0 -v 1 -n ${wifi_ssid_1} ancontrol -i an0 -v 2 -n ${wifi_ssid_2} ancontrol -i an0 -v 3 -n ${wifi_ssid_3} case ${wifi_wep_enable} in [Nn][Oo]) ancontrol -i an0 -W 0 ;; [Yy][Ee][Ss]]) ancontrol -i an0 -v 0 -k ${wifi_wep_key} ancontrol -i an0 -W 1 ;; *) ;; esac What happens is that at card insert/remove events, the pccardd uses the pccard.conf per-device settings to do low level card start/stop behaviour, and then calls pccard_ether to adjust the network. The removable_interfaces section causes pccard_ether to successfuly ifconfig the device, and re-invoke dhclient if required. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message