SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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...
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
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 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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.