From: Larry Finger <Larry.Finger@lwfinger.net>
To: "Jan Dvořák" <dvorakj@cngroup.dk>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>, linux-wireless@vger.kernel.org
Subject: Re: rtl8192cu not working with Edimax EW-7811Un
Date: Wed, 23 Nov 2011 12:41:34 -0600 [thread overview]
Message-ID: <4ECD3E5E.6010109@lwfinger.net> (raw)
In-Reply-To: <20111123175210.fd0ac6b0b66885b3deaecfc0@cngroup.dk>
[-- Attachment #1: Type: text/plain, Size: 771 bytes --]
On 11/23/2011 10:52 AM, Jan Dvořák wrote:
> On Wed, 23 Nov 2011 16:51:09 +0100
> Stanislaw Gruszka<sgruszka@redhat.com> wrote:
>> Could you confirm that on previous kernel client mode does not
>> work, and work with that new kernel?
>
> I'll try it when I get home or first thing yesterday.
>
>>> I can't still use hostapd, however.
>> Hmm, I'm not sure if rtl92c works in AP mode, Larry?
When I try it, I get rtl8192cu to beacon, and it is possible to authenticate and
associate, but the second computer never gets an IP number. I think my script to
set up dhcpd is faulty, but I cannot find the problem. I attached it - perhaps
one of you can find what I'm doing wrong. BTW, the script also fails when I try
to use b43 as an AP, and I know it works.
Larry
[-- Attachment #2: control_ap --]
[-- Type: text/plain, Size: 3230 bytes --]
#!/bin/sh
# Script to start/stop a hostapd-based access point
#
# Sample start call "control_ap start wlan0 eth0"
# Stop with "control_ap stop"
#
case "$1" in
start)
if [ $# -ne 3 ]
then
echo "Usage: $0 start AP_iface NET_iface"
exit 1
fi
;;
stop)
if [ $# -ne 1 ]
then
echo "Usage: $0 stop"
exit 1
fi
;;
*)
echo "Usage:"
echo "$0 start AP-iface net_iface"
echo "or"
echo "$0 stop"
exit 1
;;
esac
# Symbols for needed programs
IPTABLES=/usr/sbin/iptables
IFCONFIG=/sbin/ifconfig
DHCPD=/usr/sbin/dhcpd
HOSTAPD=/usr/sbin/hostapd
# Symbols for AP and external interfaces
NET_AP=$2
NET_EXT=$3
# First 3 octets of IP address for the AP
AP_ADDR=192.168.0
# IP address for nameserver
NAME_SERVER=8.8.8.8
# AP Channel, SSID, Encryption method, and Encryption secret
AP_CHANNEL=1
AP_SSID=test
WPA_SECRET="\"123456789\""
ENCRYPT_MODE=2
case "$1" in
start)
echo "Starting AP mode for $NET_AP at address $AP_ADDR"
# Disable packet forwarding
echo 0 > /proc/sys/net/ipv4/ip_forward
# Stop any existing hostapd and dhcpd daemons
killproc hostapd
killproc dhcpd
#Set up forwarding
$IPTABLES -t nat -A POSTROUTING -o $NET_EXT -j MASQUERADE
$IPTABLES -A FORWARD -i $NET_EXT -o $NET_AP -m state \
--state RELATED,ESTABLISHED -j ACCEPT
$IPTABLES -A FORWARD -i $NET_AP -o $NET_EXT -j ACCEPT
# Enable packet forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# Get the AP interface in the right state
$IFCONFIG $NET_AP down
$IFCONFIG $NET_AP up
$IFCONFIG $NET_AP $AP_ADDR.1
# dhcpd needs to have a leases file available - create it if needed
if [ ! -f /var/lib/dhcp/db/dhcpd.leases ]; then
touch /var/lib/dhcp/db/dhcpd.leases
fi
# Write the DHCP server configuration file
echo "option domain-name-servers $NAME_SERVER;" > ~/dhcpd.conf
echo "default-lease-time 600;" >> ~/dhcpd.conf
echo "max-lease-time 7200;" >> ~/dhcpd.conf
echo "ddns-update-style none; ddns-updates off;" >> ~/dhcpd.conf
echo "subnet $AP_ADDR.0 netmask 255.255.255.0 {" >> ~/dhcpd.conf
echo " range $AP_ADDR.200 $AP_ADDR.229;" >> ~/dhcpd.conf
# echo " option subnet-mask 255.255.255.0;" >> ~/dhcpd.conf
echo " option broadcast-address $AP_ADDR.255;" >> ~/dhcpd.conf
echo " option routers $AP_ADDR.1;" >> ~/dhcpd.conf
echo "}" >> ~/dhcpd.conf
# Write the hostapd configuration file
echo "interface=$NET_AP" > ~/hostapd.conf
echo "driver=nl80211" >> ~/hostapd.conf
echo "hw_mode=g" >> ~/hostapd.conf
echo "channel=$AP_CHANNEL" >> ~/hostapd.conf
echo "ssid=$AP_SSID" >> ~/hostapd.conf
echo "wpa=ENCRYPT_MODE" >> ~/hostapd.conf
echo "wpa_key_mgmt=WPA-PSK" >> ~/hostapd.conf
echo "wpa_pairwise=CCMP" >> ~/hostapd.conf
echo "wpa_passphrase=$WPA_SECRET" >> ~/hostapd.conf
# Bring up hostapd
$HOSTAPD -B ~/hostapd.conf
# Bring up the DHCP server
$DHCPD -cf ~/dhcpd.conf $NET_AP
;;
stop)
echo "Stopping AP mode"
# Stop hostapd and dhcpd daemons
killproc hostapd
killproc dhcpd
rm -f ~/hostapd.conf
rm -f ~/dhcpd.conf
;;
esac
next prev parent reply other threads:[~2011-11-23 18:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-22 10:34 rtl8192cu not working with Edimax EW-7811Un Jan Dvořák
2011-11-22 14:01 ` Stanislaw Gruszka
2011-11-23 10:23 ` Jan Dvořák
2011-11-23 14:33 ` Stanislaw Gruszka
2011-11-23 15:24 ` Jan Dvořák
2011-11-23 15:40 ` Larry Finger
2011-11-23 15:51 ` Stanislaw Gruszka
2011-11-23 16:52 ` Jan Dvořák
2011-11-23 18:41 ` Larry Finger [this message]
2011-11-24 13:03 ` Jan Dvořák
2011-11-24 15:40 ` Larry Finger
2011-11-24 16:59 ` Larry Finger
2011-11-24 17:52 ` Jan Dvořák
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ECD3E5E.6010109@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=dvorakj@cngroup.dk \
--cc=linux-wireless@vger.kernel.org \
--cc=sgruszka@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.