LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-31-2005, 08:53 AM   #1
noxious
Member
 
Registered: May 2004
Location: Ohio, USA
Distribution: LinuxMint Gloria, Ubuntu 9.10
Posts: 299

Rep: Reputation: 30
dhcpcd question


I have wireless working nicely on my compaq M700 laptop with Slackware 10.1 current. I use an Orinoco Gold pcmcia card. During boot, I get a strange message concerning dhcpcd that I don't have a clue how to get rid of. Right after LDCONFIG loads, the following messages appear:

DHCP request address 192.168.0.255

Broadcasting dhcp discover
Receivedfrom: Network is down
Broadcasting DHCP_discover
SendTo: Network is down

The machine stalls for a few seconds, then boots normally and the wireless works fine. I'm just wondering why I'm getting this and how to get rid of the apparent conflict within dhcpcd.

Thanks!
 
Old 05-31-2005, 10:06 AM   #2
killerbob
Member
 
Registered: Oct 2004
Location: Ottawa, ON
Distribution: Slackware
Posts: 662

Rep: Reputation: 31
It's trying to get DHCP before it's configured for the wireless. You can fix it by editing rc.wireless and increasing the delay between setting the SSID/key and requesting DHCP. It won't actually do anything that it isn't already doing, however; it'll just hide those messages.
 
Old 05-31-2005, 11:12 AM   #3
noxious
Member
 
Registered: May 2004
Location: Ohio, USA
Distribution: LinuxMint Gloria, Ubuntu 9.10
Posts: 299

Original Poster
Rep: Reputation: 30
Is this the line I should edit? Maybe increase the sleep time?

# Bring interface up - to avoid 'not ready' errors when calling iwconfig and
# for determining the HWADDR
$IFCOMMAND up
sleep 2
 
Old 05-31-2005, 11:50 AM   #4
killerbob
Member
 
Registered: Oct 2004
Location: Ottawa, ON
Distribution: Slackware
Posts: 662

Rep: Reputation: 31
No, that sleep time should be ok. When I look at my rc.wireless (my laptop, I'm doing some programming today and am on Windows with this computer, else I'd copy/paste what I mean), I see a whole bunch of $IWCOMMAND lines with no sleep after them...

There should be a sleep 2 after each iwconfig line. (though really, all of those options can be set with one command). Of particular importance are the iwconfig lines setting the network key, and the SSID. I'd suggest you add a sleep 2 after those two lines, and see if that helps? Or at the end of it all, before the dhcpcd line, add a sleep 2.
 
Old 05-31-2005, 01:47 PM   #5
noxious
Member
 
Registered: May 2004
Location: Ohio, USA
Distribution: LinuxMint Gloria, Ubuntu 9.10
Posts: 299

Original Poster
Rep: Reputation: 30
Hey Killerbob, could you post your rc.wireless? I've tried to stick "sleep 2" here and there in the /etc/rc.d/rc.wireless file with no effect. Also, I can't find anything that directly addresses dhcpcd in the file...
 
Old 05-31-2005, 02:11 PM   #6
killerbob
Member
 
Registered: Oct 2004
Location: Ottawa, ON
Distribution: Slackware
Posts: 662

Rep: Reputation: 31
I'm not auctually using rc.wireless, because my card is ath0.

That said, here's the script I *am* using, which you can easily modify for your uses:

Code:
#!/bin/bash
# New wlan-up script, prompt for which wireless LAN AP we want to use.
# At some point, we will be updating this so that there's a timeout of 10 seconds or so that I
# can put it at system startup. This will have to do for now.

# I am deliberately not putting in a WHILE loop. I want it to skip the setup of the WLAN if I
# don't tell it to specifically use one of the two lans.

# Global variables:
INTERFACE="ath0"
ESSID="no-essid"
KEY="none"
TIMELIMIT=5

# Show the menu:

echo ""
echo "-=-=-=- Choose a Wireless AP for connection -=-=-=-"
echo "a. Home 54mbit - Bedroom end of house"
echo "b. Home 11mbit - Dining room and Sun Room"
echo "c. University Library"
echo ""
echo "-=-=- Type anything else to cancel connection -=-=-"

read -t ${TIMELIMIT} choice

case $choice in a)
  ESSID="ssid1"
  KEY="key1"
esac

case $choice in b)
  ESSID="ssid2"
  KEY="key2"
esac

case $choice in c)
  ESSID="ssid3"
esac

if echo "${ESSID}" | grep -q "no-essid"
then
  echo "*** Exiting without configuring LAN. You can reinvoke it with /sbin/wlan ***"
else
  echo ""
  echo "Enabling ${INTERFACE}"
  ifconfig ${INTERFACE} up
  echo "  Setting ESSID"
  iwconfig ${INTERFACE} essid ${ESSID}
  sleep 2

  if echo "${KEY}" | grep -q "none"
  then
    echo "  Configuring for access without encryption"
  else
    echo "  Setting Network Key"
    iwconfig ${INTERFACE} key ${KEY}
    sleep 2
  fi

  echo "  Obtaining DHCP"
  killall dhcpcd
  sleep 1
  dhcpcd ${INTERFACE}
fi
 
Old 05-31-2005, 03:12 PM   #7
noxious
Member
 
Registered: May 2004
Location: Ohio, USA
Distribution: LinuxMint Gloria, Ubuntu 9.10
Posts: 299

Original Poster
Rep: Reputation: 30
Yow! Mine isn't even close to what you have. Did you write that yourself? It looks like we're talking about apples and oranges here maybe... Here's mine: (this is stock Slackware 10.1 current)

#!/bin/sh
# /etc/rc.d/rc.wireless
#
# Wireless network card setup.
#
# This script sets up PCI, USB, and 32-bit Cardbus wireless devices
# NOT 16-bit PCMCIA cards! Those are configured in /etc/pcmcia/.
# Single parameter to this script is the name of a network interface.
# Normally this script is called from rc.inet1 rather than run
# directly.
#
# This script is a modified '/etc/pcmcia/wireless' script
# 09/apr/2004 by Eric Hameleers
#

if [ -z $1 ] ; then
echo "Usage: rc.wireless <interface>"
return 1 2> /dev/null || exit 1
fi

INTERFACE=$1

LOGGER=${LOGGER:-cat}

# Find the path where wireless tools are installed
for IWPATH in /usr/{bin,sbin} /usr/local/{bin,sbin} /sbin ; do
if [ -x $IWPATH/iwconfig ] ; then break ; fi
done

# Set all desired settings via iwconfig
IWCOMMAND="$IWPATH/iwconfig ${INTERFACE}"
IFCOMMAND="/sbin/ifconfig ${INTERFACE}"

is_wireless_device ()
{
[ -x $IWPATH/iwconfig ] || return 1
LC_ALL=C $IWPATH/iwconfig $1 2>&1 | \
grep -q "no wireless extensions" || return 0
return 1
}

# Is the device wireless? If not, exit this script.
is_wireless_device ${INTERFACE} || return 0 2> /dev/null || exit 0

# Bring interface up - to avoid 'not ready' errors when calling iwconfig and
# for determining the HWADDR
$IFCOMMAND up
sleep 2

# Get the MAC address for the interface
HWADDR=`/sbin/ifconfig ${INTERFACE} | sed -ne 's/.*\(..:..:..:..:..:..\).*/\1/p'`

# Read the configuration information for the card with address $HWADDR
# from /etc/rc.d/rc.wireless.conf:
. /etc/rc.d/rc.wireless.conf

[ -n "$VERBOSE" -a -n "$INFO" ] && echo "$0: $1 is '$INFO'"

# Mode needs to be first : some settings apply only in a specific mode!
if [ -n "$MODE" ] ; then
echo "$0: $IWCOMMAND mode $MODE" | $LOGGER
$IWCOMMAND mode $MODE
fi
# This is a bit hackish, but should do the job right...
if [ ! -n "$NICKNAME" ] ; then
NICKNAME=`/bin/hostname`
fi
if [ -n "$ESSID" -o -n "$MODE" ] ; then
echo "$0: $IWCOMMAND nick $NICKNAME" | $LOGGER
$IWCOMMAND nick $NICKNAME
fi
# Regular stuff...
if [ -n "$NWID" ] ; then
echo "$0: $IWCOMMAND nwid $NWID" | $LOGGER
$IWCOMMAND nwid $NWID
fi
if [ -n "$FREQ" ] ; then
echo "$0: $IWCOMMAND freq $FREQ" | $LOGGER
$IWCOMMAND freq $FREQ
elif [ -n "$CHANNEL" ] ; then
echo "$0: $IWCOMMAND channel $CHANNEL" | $LOGGER
$IWCOMMAND channel $CHANNEL
fi
if [ -n "$KEY" ] ; then
echo "$0: $IWCOMMAND key ************" | $LOGGER
$IWCOMMAND key $KEY
fi
if [ -n "$SENS" ] ; then
echo "$0: $IWCOMMAND sens $SENS" | $LOGGER
$IWCOMMAND sens $SENS
fi
if [ -n "$RATE" ] ; then
echo "$0: $IWCOMMAND rate $RATE" | $LOGGER
$IWCOMMAND rate $RATE
fi
if [ -n "$RTS" ] ; then
echo "$0: $IWCOMMAND rts $RTS" | $LOGGER
$IWCOMMAND rts $RTS
fi
if [ -n "$FRAG" ] ; then
echo "$0: $IWCOMMAND frag $FRAG" | $LOGGER
$IWCOMMAND frag $FRAG
fi
# More specific parameters
if [ -n "$IWCONFIG" ] ; then
echo "$0: $IWCOMMAND $IWCONFIG" | $LOGGER
$IWCOMMAND $IWCONFIG
fi
if [ -n "$IWSPY" ] ; then
echo "$0: $IWCOMMAND $IWSPY" | $LOGGER
$IWCOMMAND $IWSPY
fi
if [ -n "$IWPRIV" ] ; then
echo "$0: $IWCOMMAND $IWPRIV" | $LOGGER
$IWCOMMAND $IWPRIV
fi

# ESSID need to be last : most devices re-perform the scanning/discovery
# when this is set, and things like encryption keys had better be
# defined if we want to discover the right set of APs/nodes.
# NOTE: when automatic association does not work, but you manage to get
# an IP address by manually setting the ESSID and then calling dhcpcd,
# then the cause might be the incorrect definition of your ESSID="bla"
# parameter in rc.wireless.conf.
# Debug your wireless problems by running 'iwevent' while the card
# is being configured.
if [ -n "$ESSID" ] ; then
echo "$0: $IWCOMMAND essid $ESSID" | $LOGGER
$IWCOMMAND essid $ESSID
fi
 
Old 05-31-2005, 04:57 PM   #8
killerbob
Member
 
Registered: Oct 2004
Location: Ottawa, ON
Distribution: Slackware
Posts: 662

Rep: Reputation: 31
I'm on the laptop and can look at how things are done, now... Yeah, I wrote that script myself. It allows for choosing between multiple networks. Since it's on the laptop, and I connect to 3 different networks, I need that functionality.


If you wanna use the stock rc.wireless, just add this to the end:

Code:
sleep 4
Experiment with different durations... 2 is probably enough, but 4 is safe.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dhcpcd afruscione Linux - Networking 3 03-21-2007 03:33 AM
dhcpcd rwescoat Linux - Networking 14 10-16-2004 12:53 PM
Help with dhcpcd jamescov Slackware 3 11-21-2003 04:25 PM
dhcpcd chrismiceli Linux - Networking 2 10-21-2002 11:09 AM
Please help, dhcpcd! majon96 Linux - Newbie 3 05-19-2002 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration