Still Not working...
Here is my dhcpd.conf
Code:
authoritative;
allow unknown-clients;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;
range 192.168.1.1 192.168.1.255;
}
And Here is the script Im running. I'm using g0tmi1k's Script but took out everything else other then starting the AP and turning on the Server.
Code:
#! /bin/bash
# (C)opyright 2009 - g0tmi1k
#
# FakeAP_pwn.sh
# Settings
export gatewayip=192.168.1.254
export internet_interface=wlan1
export fakeap_interface=ath1
echo "[>] Starting: FakeAP_pwn - g0tmi1k"
# FakeAP
echo "[+] Setting up FakeAP"
modprobe tun
xterm -geometry 75x15+1+0 -T FakeAP -e airbase-ng -P -C 30 -e "Free WiFi" $fakeap_interface -v&
sleep 2
# Tables
echo "[+] Setting up forwarding tables..."
ifconfig lo up
ifconfig at0 up
ifconfig at0 192.168.1.1 netmask 255.255.255.0
ifconfig at0 mtu 1400
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -p udp -j DNAT --to $gatewayip
#iptables -P FORWARD ACCEPT
iptables --append FORWARD --in-interface at0 -j ACCEPT
iptables --table nat --append POSTROUTING --out-interface $internet_interface -j MASQUERADE
# DHCP
echo "[+] Setting up DHCP server..."
xterm -geometry 75x25+1+100 -T DHCP -e dhcpd3 -d -f -cf /etc/dhcp3/dhcpd.conf at0&
sleep 2
echo "[+] Give them (our) internet back..."
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables -t nat -A PREROUTING -p udp -j DNAT --to $gatewayip
#iptables -P FORWARD ACCEPT
iptables --append FORWARD --in-interface at0 -j ACCEPT
iptables --table nat --append POSTROUTING --out-interface $internet_interface -j MASQUERADE
And just to give some more Info, My default gateway to wlan1 witch is the Card that is connected to the internet on is 192.168.1.254
Thanks guys.