Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Apr 2002 06:21:43 +1000
From:      George Michaelson <ggm@apnic.net>
To:        freebsd-doc@freebsd.org
Cc:        freebsd-questions@freebsd.org
Subject:   rc.conf, pccard_ether and ifconfig_<if>
Message-ID:  <200204082021.g38KLhO32116@durian.apnic.net>

next in thread | raw e-mail | index | archive | help

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.<if> and stop_if.<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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204082021.g38KLhO32116>