# cannot dhcp over bridge [SOLVED]

## javeree

I have for a while a routed NAT network running:

there is an interface 'wan', interfaces eth0, eth1 and wlan

each interfaces eth0, eth1 and wlan has its own ip address (192.168.x.1), and dnsmasq hands out dhcp addresses to these interfaces.

I now wanted to set up a bridge to join all these interfaces into a single subnet. I changed dnsmasq to assign addresses to the bridge instead of to the individual interfaces.

After /etc/init.d/net.br0 start, I can see the bridge and the interfaces with brctl show, but it looks like no dhcp requests ever make it to dnsmasq.

What could be wrong in my setup ?

 *Quote:*   

> 
> 
> # /etc/conf.d/net.br0
> 
> config_wlan="null"
> ...

 

 *Quote:*   

> 
> 
> # /etc/conf.d/dnsmasq
> 
> DNSMASQ_OPTS=""
> ...

 

P.S. module tun.ko is loaded, as I've read somewhere to be mandatoryLast edited by javeree on Sat Jun 16, 2012 10:03 pm; edited 1 time in total

----------

## olek

 *Quote:*   

> config_br0="192.168.3.1 netmask 255.255.255.0 broadcast 192.168.3.255"

 

This line gives br0 the static IP 192.168.3.1. If you want it to get an IP by a dhcp client, shouldn't it simply say:

 *Quote:*   

> config_br0="dhcp"

 

?

----------

## javeree

to clarify: the bridge is created on the same server as teh DHCP is located on.

If I do that, br0 gets a link-local IP address (br0: using IPv4LL address 169.254.252.183). 

It would also be contrary to the way it worked with NAT: 

I had to give e.g. eth0 the fixed IP address 192.168.0.1, and then in dnsmasq I had 

DNSMASQ_OPTS="-i lan -F 192.168.0.50,192.168.0.65"

In this way, a client PC gets an address in the range 192.168.0.50-65, with 192.168.0.1 as the gateway address.

I also see in the gentoo wiki 

config_br0="192.168.1.1 netmask 255.255.255.0"

----------

## olek

Ok I see, but what was the solution now?

----------

## javeree

I thought I had posted the solution. Apparently not. It turned out to be an iptables rule. Traffic used to be allowed from the  physical lan interface  but was dropped (the default action) instead of accepted from the br0 interface. So no mystery there. I think that I've got things working as before now, with just the bridge in between.

----------

