You are not logged in.

#1 2010-09-04 15:34:30

Xlator
Member
Registered: 2009-11-14
Posts: 30

Trouble with DHCP over wireless (dnsmasq, hostapd, shorewall)

Trying to make myself an Arch router in an old machine. I followed the Router guide on the Arch wiki (and the shorewall guide that was linked from there), and everything works beautifully over ethernet. WiFi is a different story however. I set up hostapd on my wireless NIC (using the ath5k driver).

I can connect to the wireless network, WPA works and everything, but dnsmasq will not serve DHCP to the wireless network.

Config files:

/etc/rc.conf 

wlan0="wlan0 10.0.1.1 netmask 255.255.0.0 broadcast 10.0.1.255"
eth1="eth1 10.0.0.1 netmask 255.255.0.0 broadcast 10.0.0.255"
eth0="dhcp"
INTERFACES=(eth0 eth1 wlan0)

/etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ssid=motherland
hw_mode=g
channel=1

macaddr_acl=0
auth_algs=1

ignore_broadcast_ssid=1
wpa=2
wpa_passphrase=********
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

/etc/dnsmasq.conf

interface=eth1
dhcp-range=eth1,10.0.0.4,10.0.0.9,255.255.0.0
interface=wlan0
dhcp-range=wlan0,10.0.1.4,10.0.1.9,255.255.0.0
dhcp-authoritative

Shorewall

interfaces:
#ZONE   INTERFACE       BROADCAST       OPTIONS
net     eth0            detect          dhcp,tcpflags,nosmurfs,routefilter,logmartians
loc     eth1            detect          dhcp,tcpflags,nosmurfs,routefilter,logmartians
loc     wlan0           detect          dhcp,tcpflags,nosmurfs,routefilter,logmartians

masq:
#INTERFACE              SOURCE          ADDRESS         PROTO   PORT(S) IPSEC   MARK
eth0                    10.0.0.0/8,\
                        169.254.0.0/16,\
                        172.16.0.0/12,\ 
                        192.168.0.0/16,\
                        10.0.1.0/8      

Offline

#2 2010-09-04 15:51:48

hexanol
Member
From: Canaduh
Registered: 2009-08-04
Posts: 95

Re: Trouble with DHCP over wireless (dnsmasq, hostapd, shorewall)

I don't know why it works on your ethernet interface and not on your WiFi, but you network address aren't right:

wlan0="wlan0 10.0.1.1 netmask 255.255.0.0 broadcast 10.0.1.255"
eth1="eth1 10.0.0.1 netmask 255.255.0.0 broadcast 10.0.0.255"

See, both eth1 and wlan0 are in the same subnet, i.e. they both are in the 10.0.0.0/16 subnet. Saying that wlan0 has a broadcast address of 10.0.1.255 when it has a netmask address of 255.255.0.0 is wrong, i.e. the right broadcast address for this is 10.0.255.255. You don't want to put 2 interfaces in the same subnet except if you really know what you are doing.

What you want to do is either to:

  • put eth1 and wlan0 on a separate subnet, for example, put eth1 on the 10.0.0.0/24 subnet and wlan0 on 10.0.1.0/24

  • bridge the two interfaces together, but last time I tried to bridge a ethernet interface with a WiFi interface, it didn't worked, i.e. it wasn't supported, so it might be easier to put each interface in a separate subnet.

I don't know if this will solve your problem, maybe not, but maybe the DHCP server is confused because of this.

Last edited by hexanol (2010-09-04 15:52:57)

Offline

#3 2010-09-04 16:02:01

Xlator
Member
Registered: 2009-11-14
Posts: 30

Re: Trouble with DHCP over wireless (dnsmasq, hostapd, shorewall)

Silly mistake... I always get subnets messed up. It works now. Boy do I feel stupid.

Thanks. smile

Offline

Board footer

Powered by FluxBB