# Multiple interfaces, dnsmasq dhcp server: problem

## madmango

I have a router with three interfaces: a local one (eth1), an adhoc wireless local one (wlan0), and the internet one (eth0). I've assigned wlan0 and eth1 static addresses:

```

eth0      Link encap:Ethernet  HWaddr 00:D0:B7:58:C8:1E

          inet addr:xx.xx.xx.xx  Bcast:xx.xx.xx.xx  Mask:255.255.248.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:21267 errors:0 dropped:0 overruns:0 frame:0

          TX packets:4560 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:8312424 (7.9 Mb)  TX bytes:447829 (437.3 Kb)

eth1      Link encap:Ethernet  HWaddr 00:04:5A:7E:05:A3

          inet addr:10.152.2.1  Bcast:10.152.2.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:4669 errors:0 dropped:0 overruns:0 frame:0

          TX packets:6092 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:478304 (467.0 Kb)  TX bytes:7352386 (7.0 Mb)

          Interrupt:10 Base address:0x4c00

[lo omitted]

wlan0     Link encap:Ethernet  HWaddr 00:0C:41:0E:98:12

          inet addr:10.152.3.1  Bcast:10.152.3.255  Mask:255.255.255.0

          UP BROADCAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

```

Okay, i think I got that right. I'm using shorewall to route the interfaces, and the routing is working correctly (as I'm posting this from a machine within the eth1 subnet). Here's my iwconfig for wlan0:

```

wlan0     IEEE 802.11-DS  ESSID:"paladin"  Nickname:"paladin"

          Mode:Ad-Hoc  Frequency:2.437 GHz  Cell: 02:00:29:AF:DB:57

          Bit Rate:11 Mb/s   Tx-Power=15 dBm

          Retry limit:20   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:off

          Link Quality:0  Signal level:0  Noise level:0

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

```

That seems to be okay. Dnsmasq give out ip addresses on eth1 based on this conf file:

```
domain-needed

resolv-file=/etc/resolv.conf

local=/kellerhome.local/

except-interface=eth0

expand-hosts

domain=kellerhome.local

dhcp-range=eth1,10.152.2.2,10.152.2.50,255.255.255.0,10.152.2.255,12h

dhcp-range=wlan0,10.152.3.2,10.152.3.50,255.255.255.255,10.152.3.255,1h

read-ethers

dhcp-option=19,0           # option ip-forwarding off

dhcp-option=46,8           # netbios node type

dhcp-option=47             # empty netbios scope.

log-queries

```

Notice I've got two entries for the two interfaces. But there's a problem. Dnsmasq refuses to give out ip addresses over wlan0. Watch:

```
Nov  3 20:45:35 phalanx root: Shorewall Started

Nov  3 20:46:29 phalanx dnsmasq[8785]: reading /etc/resolv.conf

Nov  3 20:46:29 phalanx dnsmasq[8785]: using nameserver xx.xx.xx.xx#53

Nov  3 20:46:29 phalanx dnsmasq[8785]: using nameserver xx.xx.xx.xx#53

Nov  3 20:46:29 phalanx dnsmasq[8785]: using nameserver xx.xx.xx.xx#53

Nov  3 20:46:29 phalanx dnsmasq[8785]: using local addresses only for domain kellerhome.loc

al

Nov  3 20:49:48 phalanx dnsmasq[8785]: no address range available for DHCP request via wlan

0

Nov  3 20:49:53 phalanx dnsmasq[8785]: no address range available for DHCP request via wlan

0

Nov  3 20:50:01 phalanx dnsmasq[8785]: no address range available for DHCP request via wlan

0

Nov  3 20:50:01 phalanx /usr/sbin/cron[12688]: (root) CMD (test -x /usr/sbin/run-crons && /

usr/sbin/run-crons )

Nov  3 20:50:16 phalanx dnsmasq[8785]: no address range available for DHCP request via wlan

0

Nov  3 20:52:01 phalanx dnsmasq[8785]: exiting on receipt of SIGTERM

```

Any ideas where I might have gone wrong?

----------

## madmango

Can anybody help me?

I think I'll try using a different class network (class b instead of class a) for one of the interfaces, but I have no idea why it wouldn't work the way I have it.

----------

## archrival

It looks like your netmask for the DHCP range is set to 255.255.255.255, which would obviously leave you with no valid IPs.

----------

## madmango

Holy crap! Thanks man, I missed that. Works fine now.  :Embarassed: 

----------

