OpenWrt Forum Archive

Topic: how to use an external DHCP server?

The content of this topic has been archived on 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

System: openwrt 8.09 in a WRT54GL:
I don't want to use the dhcp server inside openwrt. So if the dhcp server is a computer in my lan, how do I make clients joining the wireless network get an ip from it?. The wifi and lan are not bridged, do the dhcp server has to be on the same network than the clients?

LONG STORY:
I am testing a captive portal. I want it to capture clients connecting wirelessly. For this I have set  the wireless device and the switch on different interfaces, breaking the bridge br-0 that was set by default.
I have set the gateway for the wifi interface to the ip of the captive portal, add rules to the firewall to forward traffic between lan and wifi interfaces and not added a DHCP section for the wifi part since the captive portal is offering this service. However the clients can't join the wireless conecction. I set the dhcp service for the wifi in openwrt just to test and then the clients started joining the wireless connecion. So I guess the problem is that my clients can't obtain an ip address from the captive portal.

Maybe this is more a networking question... but I hope you can help me I don't why it doesn't work.

Thanks!

Should be done with:

root@OpenWrt:~# uci set dhcp.lan.ignore=1
root@OpenWrt:~# uci commit dhcp
root@OpenWrt:~# /etc/init.d/dnsmasq restart

If the DHCP server is on a different broadcast domain than the client (i. e. LAN and Wifi are not bridged), you need a dhcp relay agent on openwrt.

Yanira , I think that would disable the dhcp service for the lan part. I actually want dhcp for the computers connected through the switch (lan). I only want wireless clients to acquire its ip from the other dhcp server (captive portal).

MMCM, ok, that was what I thought, didn't know about the existence of dhcp relay agents though.

I am thinking of creating a vlan that comprise only the port to which the dhcp server is connected and bridge this vlan to the wifi. I think is it possible that a port belong to two different vlans, am I right? Because I'd like the dhcp server belongs to another vlan as well.

Thanks!

The discussion might have continued from here.