[SOLVED] DHCP only on wlan0, not on eth0.1

Hello Forum,

I have several routers with OpenWRT. I'm playing around.

  1. Can it be that a DHCP Server goes down if he detects another DHCP server in the same lan? I'm playing around with three OpenWRT routers behind the same switch, but it seems only one is delivering ip addresses. If I turn him down, the other router/DHCPServer remain silent. I checked, the dnsmasq jobs are running. I'm using 'udhcpc -i wlan0' or 'dhclient -v wlan0' to get a ip from a connected router directly. Only if I disconnect the routers from the switch and make a reboot, dnsmasq delivers DHCP info.

  2. How can I limit the DHCP Server only to the Wlan? All of my devices that are connected via cable have a static ip address. I only need the dhcp server for phones and guest that are connecting via wlan. I tried to split the default bridge of eth0.1 and wlan0 and made separate interfaces, with DHCP only behind wlan0 interface. I put wlan0 interface into the same firewall zone as eth0.1 with forwarding to wan, but DHCP never delivered a default Gateway to the Wlan clients.

Thanks

Peter

Yes, see https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/network/services/dnsmasq/files/dnsmasq.init;h=c1ae0934fd2c466687c80f7ae7f6fa567e4474fa;hb=HEAD#l75

You can override that behaviour by setting option force 1 in the config dhcp section of /etc/config/dhcp.

You need to break the ethernet-wifi bridge, declare a new logical interface (e.g. "wlan"), move the wlan0 interface there and disable the DHCP service on "lan".

1 Like

Thanks for the info :slight_smile:

-- I took PHY wlan0 out of the LAN interface, only PHY eth0.1 remains with static ip 192.168.1.1.
-- I removed the DHCP Server from LAN interface.
-- I created a new interface for wlan0 with a static ip address 192.168.1.2.
-- I put the wlan0 interface into the same firewall zone as LAN. (With forwarding to wan)
-- I add DHCP Server to the wlan0 interface, even with DHCP Option '3,192.168.1.2' for explicit setting the default gateway.
-- If I look in Luci Firewall->Zones, Default Policy for the lan and wlan0 zone is 3* Accept. I cant see in the firewall traffic rules nothing special for the lan Zone that I have to duplicate for the wlan0 zone.

If I look at the smartphone (:=SP), the SP gets a IP from the range I defined for the wlan0 interface. If I change the range, the SP gets another ip from the new range. But 'route' shows no default route.

If you separated the wireless and wired networks into separate VLANs and a PHY, you cannot number the wireless in the same subnet.

Use e.g. 192.168.3.0/24 instead.

This should be unnecessary...are you actually trying to run mutiple DHCP servers on purpose?

Why do you require DHCP only on wlan0 if all other devices have static addressing anyways?

1 Like

Thanks, it worked :slight_smile:

Beside my main router I have two other routers. I put OpenWRT on it and now I'm playing around with several configs. Idk toward this leads. Now I can reach all three routers from my laptop. Thanks a lot!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.