I am using a Xiaomi router 4 (R4) with OpenWrt 21.02.3 r16554-1d4dea6d4f.
I want to connect to the internet using DHCP but WAN DHCP client does not take IP.
What might be causing this problem? Is there anything I need to change in LAN, to make sure requests to external IPs are sent to WAN correctly?
Thanks
/etc/config/network
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 packet_steering '1'
option ula_prefix 'fd24:a4d3:b94a::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '10.0.0.1'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
I don't see any obvious problems with this config. Where you want to get the address from? If it is an ISP, then maybe there is some authorization be mac address,etc.
Check the logs.
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: read /tmp/hosts/dhcp.cfg01411c - 0 addresses
Fri Aug 26 17:03:39 2022 user.notice ucitrack: Setting up /etc/config/network reload dependency on /etc/config/dhcp
Fri Aug 26 17:03:39 2022 user.notice ucitrack: Setting up /etc/config/dhcp reload dependency on /etc/config/odhcpd
Fri Aug 26 17:03:39 2022 user.notice ucitrack: Setting up /etc/config/system reload dependency on /etc/config/dhcp
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq-dhcp[2477]: DHCP, IP range 10.0.0.100 -- 10.0.0.249, lease time 12h
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq-dhcp[2477]: read /etc/ethers - 0 addresses
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq-dhcp[2477]: DHCPREQUEST(br-lan) 10.0.0.174 04:7c:16:0a:31:25
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq-dhcp[2477]: DHCPACK(br-lan) 10.0.0.174 04:7c:16:0a:31:25 WIN-VJVCVVHJH5R
Fri Aug 26 17:03:46 2022 daemon.info dnsmasq[2477]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
Fri Aug 26 17:03:46 2022 daemon.info dnsmasq-dhcp[2477]: read /etc/ethers - 0 addresses
Fri Aug 26 17:03:47 2022 daemon.notice netifd: wan (2734): udhcpc: started, v1.33.2
Fri Aug 26 17:03:47 2022 daemon.err odhcp6c[2733]: Failed to send RS (Address not available)
Fri Aug 26 17:03:47 2022 daemon.notice netifd: wan (2734): udhcpc: sending discover
Fri Aug 26 17:03:48 2022 daemon.err odhcp6c[2733]: Failed to send SOLICIT message to ff02::1:2 (Address not available)
Fri Aug 26 17:03:50 2022 daemon.notice netifd: wan (2734): udhcpc: sending discover
Fri Aug 26 17:03:53 2022 daemon.notice netifd: wan (2734): udhcpc: sending discover
logread -e dnsmasq
Fri Aug 26 17:03:36 2022 user.notice dnsmasq: DNS rebinding protection is active, will discard upstream RFC1918 responses!
Fri Aug 26 17:03:36 2022 user.notice dnsmasq: Allowing 127.0.0.0/8 responses
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: Connected to system UBus
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: started, version 2.85 cachesize 150
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: DNS service limited to local subnets
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth cryptohash DNSSEC no-ID loop-detect inotify dumpfile
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: UBus support enabled: connected to system bus
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: using only locally-known addresses for domain test
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: using only locally-known addresses for domain onion
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: using only locally-known addresses for domain localhost
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: using only locally-known addresses for domain local
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: using only locally-known addresses for domain invalid
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: using only locally-known addresses for domain bind
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: using only locally-known addresses for domain lan
Fri Aug 26 17:03:36 2022 daemon.warn dnsmasq[1378]: no servers found in /tmp/resolv.conf.d/resolv.conf.auto, will retry
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: read /etc/hosts - 4 addresses
Fri Aug 26 17:03:36 2022 daemon.info dnsmasq[1378]: read /tmp/hosts/dhcp.cfg01411c - 0 addresses
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[1378]: exiting on receipt of SIGTERM
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: Connected to system UBus
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: started, version 2.85 cachesize 150
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: DNS service limited to local subnets
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth cryptohash DNSSEC no-ID loop-detect inotify dumpfile
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: UBus support enabled: connected to system bus
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq-dhcp[2477]: DHCP, IP range 10.0.0.100 -- 10.0.0.249, lease time 12h
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: using only locally-known addresses for domain test
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: using only locally-known addresses for domain onion
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: using only locally-known addresses for domain localhost
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: using only locally-known addresses for domain local
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: using only locally-known addresses for domain invalid
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: using only locally-known addresses for domain bind
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: using only locally-known addresses for domain lan
Fri Aug 26 17:03:45 2022 daemon.warn dnsmasq[2477]: no servers found in /tmp/resolv.conf.d/resolv.conf.auto, will retry
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: read /etc/hosts - 4 addresses
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq[2477]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq-dhcp[2477]: read /etc/ethers - 0 addresses
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq-dhcp[2477]: DHCPREQUEST(br-lan) 10.0.0.174 04:7c:16:0a:31:25
Fri Aug 26 17:03:45 2022 daemon.info dnsmasq-dhcp[2477]: DHCPACK(br-lan) 10.0.0.174 04:7c:16:0a:31:25 WIN-VJVCVVHJH5R
Fri Aug 26 17:03:46 2022 daemon.info dnsmasq[2477]: read /etc/hosts - 4 addresses
Fri Aug 26 17:03:46 2022 daemon.info dnsmasq[2477]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
Fri Aug 26 17:03:46 2022 daemon.info dnsmasq-dhcp[2477]: read /etc/ethers - 0 addresses
It has another mac address. ISP can check it. For instance in my place I have to wait 10 min when I change a device before I get to the authorization page to link a new device. It depends on ISP.
Some ISP's require extra steps be taken when swapping hardware. For example, when I swap routers, i have to power cycle my cablemodem. Other ISP requirements may be different.
This is common with cable. To have the company forget your old router's MAC, don't just wait, but unplug your cable modem and leave it off for 30 minutes.
There are some settings in the configs you posted that don't make sense, like masq being on LAN. OpenWrt's default settings are intended to get online with a DHCP WAN connection.