The right way to do DHCP with wi/ed?

Scott Lambert lambert at lambertfam.org
Mon Apr 7 11:55:24 PDT 2003


On Mon, Apr 07, 2003 at 08:39:22AM -0400, Dan Langille wrote:
> What is the correct way to do DHCP with wi0?  I've been trying 
> various methods, but the only solution I've found is to do this:  
> 
> /etc/rc.conf:
> ifconfig_wi0="DHCP"
> pccard_enable="YES"
> dhcp_program=/tmp/foo
> 
> /tmp/foo:
> ( /sbin/dhclient -d $* & ) > /tmp/foo.out 2>&1
> 
> If I don't use /tmp/foo, dhclient hangs.  So far, the dicussion on 
> the ISC DHCP client list hasn't found a solution.  The lease is 
> granted, but wi0 never gets an IP addresses.  If interested, the 
> thread is at http://marc.theaimsgroup.com/?t=104950219300003&r=1&w=2

I use the {start|stop}_if.* files for my wi0 setup, my fxp0 too.

start_if.wi0:
#!/bin/sh
#/sbin/ifconfig wi0 up
/sbin/ifconfig wi0 wepkey 0xXXXXXXXXXXXXXXXXXXXXXXXXXX wepmode on
#echo "sleeping 15 seconds to allow time to associate..."
#sleep 15
dhclient -pf /var/run/dhclient.wi0.pid wi0

stop_if.wi0:
#!/bin/sh
/bin/kill `cat /var/run/dhclient.wi0.pid`


Sometimes, it seems that I need to uncomment the #'d lines in
start_if.wi0 in order to get dhclient to work properly.  

I created stop_if.wi0 after dhclient started consuming all CPU when I
removed the card.

This also allows me to change locations fairly easily by adding a case
statement to start_if.xxx so I can manually run it with an argument
telling it where I am and how to deal with the network there.

Be sure to use:
pccardd_flags="-z"      # Additional flags for pccardd.

in rc.conf.  It is now the default.

-- 
Scott Lambert                    KC5MLE                       Unix SysAdmin
lambert at lambertfam.org      


More information about the freebsd-mobile mailing list