# dhcp on bridge



## arachnid (Jan 25, 2012)

Sorry, I can't find anything in Google about my problem. I made my netbook for WiFi AP - with bridge WiFi and ethernet interfaces. but IP to ethernet I get from dhcp - and I put in rc.conf next line:


```
cloned_interfaces="bridge0" 
ifconfig_bridge0="addm re0 addm wlan0 up" 
create_args_wlan0="wlanmode hostap" 
ifconfig_wlan0="up" 
ifconfig_wlan0="up ssid freebsdap mode 11g channel any" 
ifconfig_re0="up" 
ifconfig_bridge0="DHCP"
```

and after reboot my bridge is empty 

But if I delete string about dhcp to bridge - all ok, but after logon I need to run
[cmd=]#dhclient bridge0[/cmd]

What do I need to write in rc.conf to send request from bridge to dhcpd on boot?


----------



## SirDice (Jan 25, 2012)

arachnid said:
			
		

> ```
> ifconfig_bridge0="addm re0 addm wlan0 up"
> ifconfig_bridge0="DHCP"
> ```


These two overrule each other. The left bit is actually a variable that's read by the rc scripts. So the second definition overrules the first.

I'm not sure this is going to work but try putting everything together:

```
ifconfig_bridge0="addm re0 addm wlan0 up DHCP"
```


----------



## arachnid (Jan 26, 2012)

Thank SirDice for your advice.
I add DHCP to string ifconfig_bridge0. After reboot - bridge created successfully, request to dhcpd - no.


----------



## gnoma (Feb 1, 2012)

Hello,

Can you try to leave the wi-fi interface out of the bridge for a single reboot. Create the bridge as usual, but make only re0 a member. Then check if the bridge0 will *dhclient* automatically just for the test. I had the same problem with wi-fi on hostap, but I used it static IP. I made it work with:

```
ifconfig_bridge0_alias0=
```

But it was on FreeBSD 7, anyway you can try it. 

Here's what I did:

```
cloned_interfaces="bridge0"
ifconfig_bridge0="addm rl0 addm rt28600 addm tap0 up"
ifconfig_rl0="up"
ifconfig_rt28600="mode 11g ssid UnixFBSD_AP mediaopt hostap up"
ifconfig_bridge0_alias0="inet 192.168.1.1 netmask 255.255.255.0"
```

Hope it works.

Thank you.


----------

