1. Current Location: Home >  Router Encyclopedia >  Is DHCP assigned the wrong IP segment in OpenWrt? Three-step investigation and repair

Is DHCP assigned the wrong IP segment in OpenWrt? Three-step investigation and repair

after flashing OpenWrt, everything worked fine, but a device suddenly couldn't access the Internet, and when I looked at the IP address - was not a regular 192.168.1.x, but a strange 10.x.x.x or 172.x.x.x address.

this situation is usually caused by a problem with the DHCP server configuration, IP segment conflict, or a misconfiguration of the LAN interface.


1. Confirm first: where is the problem

check the following three locations in the OpenWrt console (LuCI) in turn, 90% of the problems are in the first :

 Location 1: Network → Interface → LAN → Basic Settings Location 2: Network → Interface → WAN → Basic Settings Location 3: Service → DHCP/DNS 

Typical false symptom control:

Is DHCP assigned the wrong IP segment in OpenWrt? Three-step investigation and repair


2. Step 1: Check the configuration of the IP segment of the LAN port

Operation: OpenWrt → Network → Interface → LAN → Edit

find the " Basic Settings" tab:

IPv4 Address: 192.168.1.1 ← This is the router LAN port IP IPv4 subnet mask: 255.255.255.0 

Common Mistake 1: LAN port and WAN port are on the same CIDR segment

if the WAN port is set to a DHCP client and the parent route also happens to be 192.168.1.x, the LAN and WAN segments will cause route confusion.

Fix:

 change the LAN port to: 192.168.2.1 WAN Port Hold: DHCP Client (Auto-Fetch) 

this way, the LAN is an intranet, and the WAN obtains the parent IP address normally without interfering with each other.

Common Error 2: The LAN port IP is manually set to the public IP segment

some users mistakenly changed the LAN IP in the "Advanced Settings":

# Misconfiguration IPv4 address: 10.0.0.1 ← and WAN acquired CIDR blocks are in conflict! # Configure correctly IPv4 address: 192.168.X.1 (X arbitrary, but not overlapping with WAN segments) 

3. Step 2: Check the DHCP server range

Operation: Network → Interface → LAN → DHCP Server

set the IP range that can be assigned to private devices here.

Standard Reference:

DHCP Server: ✓ enabled Starting IP: 192.168.1.100 End IP: 192.168.1.249 Rental duration: 12 hours 

points to check:

  1. DHCP Whether is enabled – Some users disable it without realizing it, resulting in the device not being able to reach IP
  2. IP Does the range match the LAN port network segment - LAN is 192.168.1.x, and the DHCP range must also be this segment
  3. DHCP Does the range conflict with static assigned IPs - If you manually set a static IP for some devices (such as 192.168.1.10), make sure that the DHCP starting IP starts at 100 to avoid conflicts

repair and save and apply before the device reacquires the IP:

# Windows PC is forced to reacquire the IP ipconfig /release ipconfig /renew # Mac / Linux sudo dhclient -r sudo dhclient 

4. Step 3: Check whether the parent route/optical cat has a DHCP conflict

if the router's WAN port is connected to the optical cat, and the optical cat also has DHCP enabled, and the IP address is assigned at the same time, the intranet will be messed up.

Troubleshooting Method:

  1. connect the computer directly to the optical cat (bypassing the router) to see which IP segment you get
  2. connect back to the router and access the Internet through the router to see which IP segment the device gets
  3. if both IP fields are the same, → optical cat and router DHCP conflict

solution (choose one):

Is DHCP assigned the wrong IP segment in OpenWrt? Three-step investigation and repair


5. Quickly verify DHCP status with a command

executed in OpenWrt's SSH terminal:

# View the current DHCP allocation of the LAN port cat /tmp/dhcp.leases # Check if dnsmasq is listening to port 67 (DHCP port) normally netstat -tulnp | grep :67 # Check the LAN interface configuration uci show network.lan 

example of normal output:

100 aa:bb:cc:dd:ee:ff 192.168.1.102 DEVICE-NAME 01:aa:bb:cc:dd:ee:ff 

if the dhcp.leases file is empty or small, it means that no device has successfully acquired the IP, and the problem is at the DHCP layer.


6. Ultimate Fix: Reset Network Interface

If the configuration is confusing and I don't know where it has been changed, you can use the command to reset the network configuration with one click:

# Reset the network configuration to default (keep the LAN port IP at 192.168.1.1) uci revert network uci revert dhcp # Restart the network service /etc/init.d/network restart /etc/init.d/dnsmasq restart 

or in the LuCI interface: Reset system → backup/upgrade → to the default firmware (only reset the configuration, no firmware flashing).

Read More


Copyright Notice Scan to read on mobile
All Rights Reserved: 《SHUNOT》 => 《Is DHCP assigned the wrong IP segment in OpenWrt? Three-step investigation and repair
Article URL: https://www.shunot.com/en/lybk/728.html
Unless otherwise stated, all articles are original by 《SHUNOT》. Reposting is welcome! Please indicate the original URL when reposting, thank you.

Contact Us

Online Consultation: Click here to send me a message

WeChat ID: master_135

Scan to follow