I have been trying to configure bt4r1 to use airbase along with dhcp. However, while the clients are able to connect, they never get ip addresses. The following is, from start to finish, my process. Note that I have replaced (consistently) all the MAC addresses with fakes. I'm a bit of a paranoid loony.
I insert my usb wireless card (Alfa AWUS036H), check dmesg to make sure everything went well.
Code:
usb 1-4: new high speed USB device using ehci_hcd and address 4
phy1: Selected rate control algorithm 'minstrel'
phy1: hwaddr 00:c0:ca:3e:f3:eb, RTL8187vB (default) V1 + rtl8225z2, rfkill mask 2
rtl8187: Customer ID is 0xFF
Registered led device: rtl8187-phy1::radio
Registered led device: rtl8187-phy1::tx
Registered led device: rtl8187-phy1::rx
rtl8187: wireless switch is on
usbcore: registered new interface driver rtl8187
All looking good, I put it into monitor mode.
Code:
root@bt:~# airmon-ng check
root@bt:~# airmon-ng start wlan1
Interface Chipset Driver
wlan0 Intel 3945ABG iwl3945 - [phy0]
wlan1 RTL8187 rtl8187 - [phy1]
(monitor mode enabled on mon
I now check to make sure my wireless card is up to snuff.
Code:
root@bt:~# aireplay-ng --test mon0
12:10:05 Trying broadcast probe requests...
12:10:05 Injection is working!
12:10:07 Found 2 APs
12:10:07 Trying directed probe requests...
12:10:07 C0:3F:0E:B5:03:5E - channel: 1 - 'redacted1'
12:10:08 Ping (min/avg/max): 3.401ms/26.161ms/44.078ms Power: -61.14
12:10:08 29/30: 96%
12:10:08 00:25:9C:D1:19:6A - channel: 1 - 'redacted2'
12:10:09 Ping (min/avg/max): 2.738ms/14.681ms/39.091ms Power: -66.52
12:10:09 23/30: 76%
I start airbase. I want the channel to be '5', the essid to be 'A trap', and some debugging info. I run this on the monitor mode enabled interface I created with airmon.
Code:
root@bt:~# airbase-ng -c 5 -e 'A trap' -v mon0
12:15:03 Created tap interface at0
12:15:03 Trying to set MTU on at0 to 1500
12:15:03 Trying to set MTU on mon0 to 1800
12:15:03 Access Point with BSSID 00:C0:CA:3E:F3:EB started.
I grab my 802.11 enabled phone, switch on wireless, and connect
Code:
12:15:54 Got an auth request from 38:E7:D8:A7:C7:59 (open system)
12:15:54 Client 38:E7:D8:A7:C7:59 associated (unencrypted) to ESSID: "A trap"
Great! Works so far. Now I want to configure a DHCP server.
I want the network to be 192.168.2.0 (netmask: 255.255.255.0), gateway/AP (at0) to be 192.168.2.1, and ip address leases to span 192.168.2.100-200.
I configure at0 to match this scheme.
Code:
root@bt:~# ifconfig at0 up ip 192.168.2.1 netmask 255.255.255.0
root@bt:~# ifconfig at0
at0 Link encap:Ethernet HWaddr 00:c0:ca:3e:f3:eb
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::2c0:caff:fe3e:f3eb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:52 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:13364 (13.3 KB) TX bytes:328 (328.0 B)
And then edit /etc/dhcp3/dhcpd.conf
Code:
ddns-update-style none;
# I had no idea what I should put for this so I settled on "home"
option domain-name "home";
# OpenDNS servers found in http://theos.in/windows-xp/free-fast-public-dns-server-list/
option domain-name-servers 208.67.222.222, 208.67.220.220;
default-lease-time 600;
max-lease-time 7200;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.100 192.168.2.200;
}
Now, with crossed fingers, I start the dhcp server
Code:
root@bt:~# touch /var/run/dhcpd.pid
root@bt:~# chown dhcpd:dhcpd /var/run/dhcpd.pid
root@bt:~# dhcpd3 -d at0
Internet Systems Consortium DHCP Server V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Wrote 0 leases to leases file.
Listening on LPF/at0/00:c0:ca:3e:f3:eb/192.168.2/24
Sending on LPF/at0/00:c0:ca:3e:f3:eb/192.168.2/24
Sending on Socket/fallback/fallback-net
And once again I try to connect my phone..
Code:
12:36:12 Got an auth request from 38:E7:D8:A7:C7:59 (open system)
12:36:12 Client 38:E7:D8:A7:C7:59 associated (unencrypted) to ESSID: "A trap"
But dhcpd3 stays quiet and, after trying to obtain an ip address for awhile and failing, my phone gives up.
How come?
Thank you for reading,
Max Carini