Use single DHCP rather than my router DHCP

Hello,

I'm trying to replace my router's DHCP server as it doesn't allow me to change DNS configuration.

My router is Brovi H158-381 and my Openwrt device is Nanopi R5S.
My router is plugged from LAN into R5S WAN port.

My plan is to use the Router (H158) to access the internet and as a WIFI access point, but I want openwrt to manage DNS and DHCP server for IP allocations on all devices connected to the main router WIFI or through Nanopi's LAN.

The problem I'm facing now is when connecting devices to the router WIFI they don't get an IP address from openwrt. However devices connected through LAN directly on openwrt can access the internet.

This is my network settings on openwrt. openwrt IP address is 192.168.8.2. Internet router IP is 192.168.9.1.

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd00:ab:cd::/48'

config device
        option name 'eth0'
        option macaddr 'ba:9e:ae:be:9c:92'
        option ipv6 '0'

config device
        option name 'br-lan'
        option type 'bridge'
        option ipv6 '0'
        option bridge_empty '1'
        list ports 'eth1'
        list ports 'eth2'

config device
        option name 'eth1'
        option macaddr 'ba:9e:ae:be:9c:93'

config device
        option name 'eth2'
        option macaddr 'ba:9e:ae:be:9c:93'

config interface 'lan'
        option device 'eth1'
        option proto 'static'
        option ipaddr '192.168.8.2'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option gateway '192.168.9.1'

config interface 'wan'
        option proto 'dhcp'
        option device 'eth0'
        option delegate '0'

Everything have to be on the same LAN, or is eth0 unused ?

eth0 is the wan port and eth1 & eth2 are for lan. So, I should bridge all ports you mean?

Depends on how you'd like it to work, but yes.

1 Like

Apologies for the late response and I appreciate your assistance.

I have attempted several configurations but never reached a satisfactory solution.

So the setup I’m trying to achieve is for my 5G CPE device to connect to the internet and work as a WIFI access point. And for my Nanopi to work as a DHCP server that assigns all lan IPs (including those connected to the WIFI access point) and DNS.

The most satisfactory result I reached where I used both device for DHCP, where my WIFI uses 192.168.9.(wan) the Nanopi(lan) 192.168.8..

The result was I’m able to connect to the internet on all devices. Devices from lan can communicate with wan devices but not the other way around.

I tried to bridge the interfaces and remove WAN interface, then insured that the gateway is my 5G device IP. This resulted in no internet access.

If some configuration files or outputs can be shared to make this easier to solve or understand I will be happy to share.

Also, apologies for the essay.

Does your upstream device (the 5G CPE) have support for static routes? Look through the user interface to see if it has a place for users to add custom static routes.

These are the only settings I found on my router that may resemble "routes" as nothing else is labeled with static routes.

Looked under here?

Screenshot_20241025_103629_Samsung Internet

Under this list there is only VPN, DHCP, and bridge mode.

1 Like

So from what we can tell, your ISP router doesn't support static routes.

But...

  • You could put everything behind OpenWrt instead of connecting some devices to the upstream network.
  • Additionally, you may be able to use the "bridge mode" you mentioned to pass your ISP issued IP address directly to the wan of your OpenWrt router.
  • And, if your goal is to have multiple separate networks, you can do this with OpenWrt for wired and/or wireless.

I would love to have one DHCP server, but I realized that my router would need to support static routes from searching the internet.

So, if both my router and Openwrt devices ran their own DHCP servers and I got the devices connected to the router (at 192.168.9.) to be able to connect devices connected to openwrt (at 192.168.8.) then I would have reached a solution.

With 2 interfaces one for lan and one wan, each with their own firewall. All devices cant communicate with each other, but the internet work on all devices.

With 2 interfaces one for lan and one wan, both sharing default lan firewall. Devices from lan can communicate with wan devices, but not the other way around. And I would have no access to the internet.

I tried to bridge both interfaces and disabled DHCP on my router. Devices that connected via WIFI on the router would not get an IP and I would not have internet on my lan devices.

You can only have one DHCP server on any given subnet.

It depends on what you are you are trying to achieve. Static routes doesn't change anything with the DHCP server, though.

Maybe draw a topology or describe what the goal is with each of those networks.

Yes, that's expected.

Again, this is dependent on the goals.

That will not work.

Can you explain what you are trying to achieve at a functional/practical level?

My goal would be for the 5G CPE to work as a WIFI access point and to access the internet.

And for my Openwrt device to work as a firewall and a DNS server for my network. And for all devices connected through WIFI or LAN to be able to communicate with each other.

It would be optimal to just change the default DNS server on my router, but it doesn't allow changing from default DNS server.

Basic paint drawing of how my network is setup currently.

Ok... that's fine. What devices would use this wifi connection? They would not be behind OpenWrt's routing/firewall... so would these be your trusted devices or untrusted such as guest devices?

Does your OpenWrt device have wifi?

This will not be possible with your current CPE device. Your wired devices will be able to connect to the wireless devices, but not vice versa.

DNS doesn't have much to do with this... it's a secondary element, at best.

They all would be trusted devices.

It does not. However, it can be added through PCIe card or USB dongle.

I also have the option to return or exchange the router for a TP-Link nx510v which seems from video reviews to have static routes and more options than the H158

These generally result in sub-par wifi performance relative to a proper AP.

Which router are you talking about returning? The CPE or your OpenWrt router?

Have you considered buying an AP to supplement your wired router?

I would return the 5G CPE.

As in, it would be connected to my Openwrt router through LAN to provide WIFI access? I thought about it, but I thought I can use the WIFI from the CPE itself if possible. Otherwise this could be an option.