# DHCP with dnsmasq and interface bridging

## Kresp

I'm replacing my OpenWRT home router with Gentoo machine.

I'm trying to set up DHCP with dnsmasq for local LAN, and DNS service it provides seems to work fine, but DHCP server is ignored by clients.

daemon.log on server has one DHCP-related line:

```
dnsmasq-dhcp[26810]: DHCP, IP range 192.168.100.100 -- 192.168.100.200, lease time 2d
```

Whenever I refresh dhcp lease with dhcpcd --release && dhcpcd , it falls back to link-local though:

```
dev: loaded udev

DUID 00:01:*cut*

enp30s0: IAID 6a:*cut*

enp30s0: soliciting an IPv6 router

enp30s0: soliciting a DHCP lease

enp30s0: probing for an IPv4LL address

enp30s0: using IPv4LL address 169.254.101.237

enp30s0: adding route to 169.254.0.0/16

enp30s0: adding default route

forked to background, child pid 20256

```

dnsmasq.conf goes like this:

```
interface=enp4s0

dhcp-range=enp4s0,192.168.100.100,192.168.100.200,255.255.255.0,48h

```

I tried removing mentions of enp4s0 interface, it made no difference.

Is there some DHCP debugging tool similar to dig/nslookup for DNS?

Another, related, question is how do I group few NICs together so that every machine that gets DHCP lease on any of those, becomes part of the same subnet and can talk to each other normally? Do I create network bridge for those interfaces or should it be done with an iptables rule?

----------

## mike155

 *Quote:*   

> Another, related, question is how do I group few NICs together so that every machine that gets DHCP lease on any of those, becomes part of the same subnet and can talk to each other normally? Do I create network bridge for those interfaces or should it be done with an iptables rule?

 

If you want the clients attached to the NICs to be in the same IP subnet, you need a layer 2 connection. Create a bridge over the NICs. You will get an additional interface "br0", which you can use to connect your Gentoo machine to the bridge. Your DHCP server should listen and answer requests on br0.

----------

