Hi
I have configured my debian 8 i586 with two wireless interfaces. One is in client mode (wlan0) and the other is in AP mode (wlan1). Everything works fine but once the clients are authenticated in the AP network they don't get an IP via DHCP and they can't ping any host on the network.
These are my configuration files
/etc/network/interfaces.d/wlan0.conf
Code:
auto wlan0
iface wlan0 inet static
address 192.168.1.247
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1 80.58.61.250
#wpa-driver wext
wpa-ssid My_SSID
wpa-psk xxxxxxxxxxxxxxx
wpa-key-mgmt WPA-PSK
## for WPA
wpa-pairwise TKIP
wpa-group TKIP
wpa-proto WPA
## for WPA2
#wpa-pairwise CCMP TKIP
#wpa-group CCMP TKIP
#wpa-proto RSN
#wireless-mode Managed
/etc/network/interfaces.d/wlan1.conf
Code:
auto wlan1
iface wlan1 inet static
address 192.168.3.1
netmask 255.255.255.0
broadcast 192.168.3.255
hostapd /etc/hostapd/hostapd.wlan1.conf
up nat.sh wlan1 wlan0 "192.168.3.0/24"
/etc/hostapd/hostapd.wlan1.conf
Code:
interface=wlan1
driver=nl80211
ssid=testing
channel=11
hw_mode=g
auth_algs=3
ignore_broadcast_ssid=0
wep_default_key=1
wep_key1="abcde"
wep_key_len_broadcast="5"
wep_key_len_unicast="5"
wep_rekey_period=300
/etc/dnsmasq.more.conf
Code:
interface=wlan1
dhcp-range=192.168.3.10,192.168.3.250,12h
dhcp-leasefile=/var/tmp/dnsmasq.leases
nat.sh
Code:
#!/bin/sh
if [ -z $1 ] || [ -z $2 ] || [ -z $3 ] ; then
echo "$0 <nat device> <output device> <network address>"
exit
fi
iptables -t nat -N "$1"-NAT 2>/dev/null
iptables -t nat -F "$1"-NAT
iptables -t nat -D POSTROUTING -j "$1"-NAT 2>/dev/null
iptables -t nat -A POSTROUTING -j "$1"-NAT
iptables -t nat -D "$1"-NAT -j MASQUERADE 2>/dev/null
iptables -t nat -A "$1"-NAT -o "$2" -s "$3" -j MASQUERADE
# Testing : used for integration with nocat
iptables -N "$1"-FORWARD 2>/dev/null
iptables -F "$1"-FORWARD
iptables -D "$1"-FORWARD -j ACCEPT -s "$3" 2>/dev/null
iptables -A "$1"-FORWARD -j ACCEPT -s "$3"
iptables -D FORWARD -j "$1"-FORWARD -s "$3" 2>/dev/null
iptables -I FORWARD 1 -j "$1"-FORWARD -s "$3"
iptables -N "$1"-INBOUND 2>/dev/null
iptables -F "$1"-INBOUND
iptables -D "$1"-INBONUD -j ACCEPT -d "$3" 2>/dev/null
iptables -A "$1"-INBOUND -j ACCEPT -d "$3"
iptables -D FORWARD -j "$1"-INBOUND -d "$3" 2>/dev/null
iptables -I FORWARD 1 -j "$1"-INBOUND -d "$3"
What is wrong here?