Wireless repeater and DHCP for it's local segment

Hello everyone!
I have two TP-Link TL-WR1043ND routers with OpenWrt 22.3.3 on them. One is AP and second is Repeater (configured according to Wireless network bridge (wireless repeater) article). It's working well itselfs. But there's one detail. AP and Repeater are far from each other, and connection between them realizes via two directional antennas (one to one). Sometimes connection losts and 'Repeater segment of the LAN' can't reach internet. But it's not critical. The other thing, that hosts don't receive DHCP lease from AP and can't connect each other too. The manual network settings for PCs in that LAN segment coud be solution. But how to be with net printer? I can't realize how to configure it with manual network settings. However, it works well with DHCP leases.

So, the question, is it possible to 'proper' configure DHCP server on the Repeater? I mean, Repeater's DHCP server gives out leases to 'Repeater segment of the LAN', and not to "Main AP segment of the LAN'?

ps According to How-to (link above), the first repeater configuration step is to change default IP and disable DHCP. Can it be disabled only for AP direction?

While it is possible to have 2 DHCP servers, it can be tricky. For your usecase it would make more sense to just raise the lease time so that the link has enough time to recover.

1 Like

Raising the time doesn't solve the problem, as the connection can be lost just before end of time. Besides, printer is not always turned on. And it can be needed when there's no connection to AP.

When two DHCP servers are in one subnet, can it be separated by firewalls on AP and Repeater?

That's not how dhcp works. The clients will try to renew at half of lease time. So if you set 30 days, they will try to renew on 15th day.

It can be, are you familiar with ebtables or some other L2 firewall? But it is not necessary to block it anyway. Proper configuration from both sides is enough.

This could be approached with symmetric routing. The repeater group would have their own IP subnet and local DHCP server always active in the repeater router. The repeater router makes a wireless connection using a WAN network to the main router and obtains a reserved IP from the main router's DHCP.

Symmetric routing means that it is not the usual lan->wan where LAN users are NATd as they go to the wan. To set this up:

  • In the repeater, turn off NAT (masquerade) on the wan
  • In the repeater, configure to allow forwarding wan->lan in addition to the existing default lan->wan.
  • In the main router, configure a DHCP reservation so the repeater router always has the same IP which you will need for the next step.
  • In the main router, install the return route: repeater lan.0/24 via repeater's IP on the main lan.

If the printer is in the repeater group, users on that side can always use it as usual even if the link to the main router is down. They would have no Internet or usage of devices on the main lan. Users of the main lan who want to print something will need to manually enter the printer's IP (on the repeater lan) into their OS printer configuration. (The printer should have a DHCP reservation so this IP is always the same). Then the main router will send that traffic through the link to the repeater router which will send it on to the printer.

What the default value? 24h? There was frequently enough when Repeater lost connection to AP and the lease ends up. So, I had Repeater which was inaccessible in any ways. Only waiting when it establish connection again.

Set 30 days? If there will no connection on the 15th, will it try to renew on 16th, 17th...?

Yes, nftables is all ours :slight_smile:
The proper configuration of DHCP on both sides? Do you mean the same lease table (HOST-IP-MAC) on both DHCP, so these servers will 'peasely' work just in parallel.

But if I set wireless to WAN, Repeater will not provide network for wireless hosts (smartphones), isn't it?



Same static leases on both and separate pools each.

Are you doing that now? With a AP and STA on single radio there is a problem that if the STA loses its link the AP will shut down.
Anyway, any device connected to the repeater will obtain an IP address in the repeater LAN, which is routable to the Internet assuming the link to the main router is up.

trendy, it seems to be interesting. I have to test both methods you advise. Maybe the "30 days" will be enough.

Yes. Repeater provides network for both wired and wireless hosts.
Here's little fragment from howto (see link in my first post):

For wireless connection, one additional step is required:

Create a new wireless interface. You can simply add it in LuCi → WiFi, or create a new wifi-iface section in /etc/config/wireless. Copy all the values from the existing interface, but make two changes: use mode 'ap' instead of 'sta' and leave out the WDS option or set it to 0. SSID and key may be the same as with the host SSID for transparent roaming, but they can also be different. As long as you connect this new interface to lan, which is the default, your other wireless devices connecting through this AP will also be seen as part of the big network.

When Repeater loses connect to main AP, it doesn't matter which interfaces are up or down. Because all hosts from 'Repeater segment of the LAN' can't connect each other ...because that LAN segment doesn't have DHCP.

There's the additional complication that if the link to the main router goes down, the repeater AP will also go off the air and no wireless clients can be served at all. This can be prevented by using the travelmate package. However even with travelmate, the AP will go down for a time before it is determined that the main router AP is not reachable. That will make all the clients reconnect and DHCP again.

Really the best solution to this is to improve the link so that it is reliable.

Oh, I see now. Really didn't think about it before.

Tested that. It's not exactly like you describe. The repeater wireless doesn't go down. Android smartphones still can see 'OpenWrt'. On connection it returns "Connected to device. Can't provide internet." Local (repeater's segment of LAN) routings also work.

Seems to be working like I want. But additional tests are needed. Details I will report later.

Well, three weeks passed. No failures were observed. The settings are (only repeater host):


config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr ''
        option netmask ''
        option gateway ''
        list dns ''
        list dns ''


config domain
        option name 'router'
        option ip ''

config dhcp 'lan'
        option force '1'

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