Redmi AC2100 loosing WAN configuration

After installing openwrt 23.05.04 successfully on my Redmi AC2100 Router, if any change in interface happens or sys-upgrade is done, router looses its WAN configuration. I have to plug my laptop to lan port, manually configure IP address and then unconfigure and configure wan interface after which wan interface starts working. Even hard reset to router doesnt bring default openwrt wifi and wan interface.

Wifi is never enabled by default.

what kind of config is this ?

that's what reset means, isn't it ?
as @brada4 pointed out, wifi is off by default.

Well is this expected on WAN interface as well that it needs reconfiguration after reset or sysupgrade? Without reconfiguring WAN interface doesnt go up. Also its very difficult for me to reach router as i am accessing it remotely.

No, it works out of the box in most scenarios, what makes your setup special, we don't know.

That you can't blame the router for...

How does your wan connection work? Specifically:

  • DHCP (default)
  • PPPoE (2nd most common connection method)
  • Static IP (uncommon for most residential connections)

And... does your ISP require the use of a tagged VLAN?

If your wan requires PPPoE or Static IP connectivity and/or a tagged VLAN, it would be expected that you would need to reconfigure it after you have reset the router to defaults (simple reset, or part of an upgrade without preserving settings).

If you use DHCP (without a tagged VLAN), that is the default config and usually doesn't require any additional changes or actions.

I also understand that should be behavior. My setup is very simple, OpenWRT router (wan port) connected to ISP Modem (Lan port). I am
Not changing anything out of the box. I tried flashing with sysupgrade as well but problem persist.

We need to know:

  1. The method used to connect the wan to the upstream (see my earlier question/post)
  2. If the upstream device is a modem/ONT or a router/modem-router combo device. If the upstream connection is providing an IP address to your OpenWrt wan on the 192.168.1.0/24 network (or any overlapping subnet), that suggests that you have a modem+router combo unit or some other situation where your upstream connection is not a direct internet connection (NAT/CG-NAT). And if that network is indeed conflicting, yes, routing will break and you'll need to make changes. This isn't OpenWrt specific, though.

Please provide us with specifics about the above and/or what exact changes you are making.

And yes, if you reset OpenWrt, it would be expected that your changes would be reset, too... that's the whole point of a reset.

My upstream is ISP DSL modem providing IP address from subnet 192.168.10.0/24 and .1 as its gateway from LAN network. No static routing or PPPoE. ISP modem is doing NAT which is very simple and common.
What i am trying to say is that as soon i do a sysupgrade or configuration restore, i loose WAN connectivity of OpenWRT. I access luci from LAN interface and just do unconfigure and configure wan in devices tab under interfaces section. Only doing this enables wan without changing any other configuration. Openwrt using 192.168,1.0/24 subnet by default so no conflict.

Please be specific about what changes you are making. Maybe show us the current config:

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

It is fairly likely that 22->23 upgrade invalidates all switch configuration on mt7621 moving from swconfig to dsa, so do not try to restore old backups, especially one of /etc/config/network.

I flashed from miwifi image to 23.05 and backup was also taken from 23.05

I brought AC2100 router to my home and it worked perfectly fine with same ethernet cable and another ISP ONT which have 1G LAN ports. My remote location (problematic one) have 100Mbps LAN ports in ISP DSL Modem and i think there is something with ports compatibility or synchronization. When i restart the router i see no downlink packets and logs showing wan interface continously going up and down. When i unconfigure and configure wan device under interfaces it works fine till the time i restart the device.

I upgraded to 24.10-RC-1 just to find a fix but this behavior is still same as in 23.05.05.

Below are logs which show interface going up and down.

4 20:16:53 2024 daemon.notice netifd: Interface 'wan' is disabled
Wed Dec  4 20:16:53 2024 daemon.notice netifd: Interface 'wan6' is disabled
Wed Dec  4 20:16:53 2024 daemon.err odhcp6c[30839]: Failed to send RS (Network unreachable)
Wed Dec  4 20:16:53 2024 daemon.warn dnsmasq[1]: no servers found in /tmp/resolv.conf.d/resolv.conf.auto, will retry
Wed Dec  4 20:16:53 2024 kern.info kernel: [  425.358477] mtk_soc_eth 1e100000.ethernet wan: Link is Down
Wed Dec  4 20:16:53 2024 daemon.notice netifd: Network device 'wan' link is down
Wed Dec  4 20:16:53 2024 daemon.notice netifd: Interface 'wan' has link connectivity loss
Wed Dec  4 20:16:53 2024 daemon.notice netifd: Interface 'wan6' has link connectivity loss
Wed Dec  4 20:16:53 2024 daemon.notice netifd: wan (30836): udhcpc: received SIGTERM
Wed Dec  4 20:16:53 2024 daemon.notice netifd: wan (30836): udhcpc: unicasting a release of 192.168.10.100 to 192.168.10.1
Wed Dec  4 20:16:53 2024 daemon.notice netifd: wan (30836): udhcpc: sending release
Wed Dec  4 20:16:53 2024 daemon.notice netifd: wan (30836): udhcpc: connect: Network unreachable
Wed Dec  4 20:16:53 2024 daemon.notice netifd: wan (30836): udhcpc: entering released state
Wed Dec  4 20:16:53 2024 daemon.notice netifd: wan (30836): Command failed: ubus call network.interface notify_proto { "action": 0, "link-up": false, "keep": false, "interface": "wan" } (Permission denied)
Wed Dec  4 20:16:53 2024 daemon.notice netifd: Interface 'wan' is now down
Wed Dec  4 20:16:53 2024 kern.info kernel: [  425.532654] mtk_soc_eth 1e100000.ethernet wan: PHY [mt7530-0:00] driver [MediaTek MT7530 PHY] (irq=POLL)
Wed Dec  4 20:16:53 2024 kern.info kernel: [  425.542265] mtk_soc_eth 1e100000.ethernet wan: configuring for phy/rgmii link mode
Wed Dec  4 20:16:53 2024 daemon.notice netifd: Interface 'wan' is enabled
Wed Dec  4 20:16:53 2024 daemon.notice netifd: Interface 'wan6' is enabled
Wed Dec  4 20:16:54 2024 user.notice ddns-scripts[31089]: myddns_ipv4: PID '31089' terminated by 'SIGTERM' at 2024-12-04 20:16
Wed Dec  4 20:16:54 2024 daemon.err odhcp6c[30839]: Failed to send SOLICIT message to ff02::1:2 (Network unreachable)
Wed Dec  4 20:16:54 2024 daemon.notice netifd: Interface 'wan6' is now down
Wed Dec  4 20:16:54 2024 daemon.info dnsmasq[1]: exiting on receipt of SIGTERM
Wed Dec  4 20:16:55 2024 daemon.err procd: Got unexpected signal 1
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: started, version 2.90 cachesize 1000
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: DNS service limited to local subnets
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-nftset no-auth no-cryptohash no-DNSSEC no-ID loop-detect inotify dumpfile
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: UBus support enabled: connected to system bus
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq-dhcp[1]: DHCP, IP range 192.168.1.100 -- 192.168.1.249, lease time 12h
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: using only locally-known addresses for test
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: using only locally-known addresses for local
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Wed Dec  4 20:16:55 2024 daemon.warn dnsmasq[1]: no servers found in /tmp/resolv.conf.d/resolv.conf.auto, will retry
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: read /etc/hosts - 12 names
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 2 names
Wed Dec  4 20:16:55 2024 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Wed Dec  4 20:16:56 2024 daemon.notice netifd: Network device 'wan' link is up
Wed Dec  4 20:16:56 2024 daemon.notice netifd: Interface 'wan' has link connectivity
Wed Dec  4 20:16:56 2024 daemon.notice netifd: Interface 'wan' is setting up now
Wed Dec  4 20:16:56 2024 kern.info kernel: [  428.680289] mtk_soc_eth 1e100000.ethernet wan: Link is Up - 100Mbps/Full - flow control off
Wed Dec  4 20:16:56 2024 daemon.notice netifd: Interface 'wan6' has link connectivity
Wed Dec  4 20:16:56 2024 daemon.notice netifd: Interface 'wan6' is setting up now
Wed Dec  4 20:16:56 2024 daemon.notice netifd: wan (31991): udhcpc: started, v1.36.1
Wed Dec  4 20:16:56 2024 daemon.err odhcp6c[31994]: Failed to send RS (Address not available)
Wed Dec  4 20:16:57 2024 daemon.notice netifd: wan (31991): udhcpc: broadcasting discover
Wed Dec  4 20:16:57 2024 daemon.err odhcp6c[31994]: Failed to send SOLICIT message to ff02::1:2 (Address not available)
Wed Dec  4 20:16:59 2024 daemon.notice netifd: wan (31991): udhcpc: broadcasting select for 192.168.10.100, server 192.168.10.1
Wed Dec  4 20:16:59 2024 daemon.notice netifd: wan (31991): udhcpc: lease of 192.168.10.100 obtained from 192.168.10.1, lease time 4294967295
Wed Dec  4 20:16:59 2024 daemon.notice netifd: Interface 'wan' is now up
Wed Dec  4 20:16:59 2024 daemon.info dnsmasq[1]: reading /tmp/resolv.conf.d/resolv.conf.auto
Wed Dec  4 20:16:59 2024 daemon.info dnsmasq[1]: using nameserver 192.168.10.1#53
Wed Dec  4 20:16:59 2024 daemon.info dnsmasq[1]: using only locally-known addresses for test
Wed Dec  4 20:16:59 2024 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Wed Dec  4 20:16:59 2024 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Wed Dec  4 20:16:59 2024 daemon.info dnsmasq[1]: using only locally-known addresses for local
Wed Dec  4 20:16:59 2024 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Wed Dec  4 20:16:59 2024 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Wed Dec  4 20:16:59 2024 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Wed Dec  4 20:16:59 2024 user.notice firewall: Reloading firewall due to ifup of wan (wan)
Wed Dec  4 20:17:01 2024 user.notice ddns-scripts[32230]: myddns_ipv4: PID '32230' started at 2024-12-04 20:17
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: exiting on receipt of SIGTERM
Wed Dec  4 20:17:01 2024 daemon.err procd: Got unexpected signal 1
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: started, version 2.90 cachesize 1000
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: DNS service limited to local subnets
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-nftset no-auth no-cryptohash no-DNSSEC no-ID loop-detect inotify dumpfile
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: UBus support enabled: connected to system bus
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq-dhcp[1]: DHCP, IP range 192.168.1.100 -- 192.168.1.249, lease time 12h
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for test
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for local
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: reading /tmp/resolv.conf.d/resolv.conf.auto
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using nameserver 192.168.10.1#53
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for test
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for onion
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for localhost
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for local
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for invalid
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for bind
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: using only locally-known addresses for lan
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: read /etc/hosts - 12 names
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 2 names
Wed Dec  4 20:17:01 2024 daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
Wed Dec  4 20:18:27 2024 daemon.notice hostapd: phy0-ap0: STA 00:08:xx:xx:cf:xx IEEE 802.11: did not acknowledge authentication resp

and below is text of commands output you asked

root@OpenWrt:~# ubus call system board
{
        "kernel": "6.6.63",
        "hostname": "OpenWrt",
        "system": "MediaTek MT7621 ver:1 eco:3",
        "model": "Xiaomi Redmi Router AC2100",
        "board_name": "xiaomi,redmi-router-ac2100",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "24.10.0-rc1",
                "revision": "r28158-d276b4c91a",
                "target": "ramips/mt7621",
                "description": "OpenWrt 24.10.0-rc1 r28158-d276b4c91a",
                "builddate": "1732901136"
        }
}
root@OpenWrt:~# cat /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 ula_prefix 'fd97:724d:f6da::/48'
        option packet_steering '1'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        option ipv6 '0'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option delegate '0'

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

config device
        option name 'wan'

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0'
        option band '2g'
        option channel '6'
        option htmode 'HT20'
        option cell_density '0'
        option country 'PK'

config wifi-device 'radio1'
        option type 'mac80211'
        option path '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
        option band '5g'
        option htmode 'VHT80'
        option country 'PK'
        option cell_density '0'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'KTSISB_5G'
        option encryption 'sae-mixed'
        option key 'sec'
        option ieee80211r '1'
        option ft_over_ds '0'
        option ocv '0'

config wifi-iface 'wifinet2'
        option device 'radio0'
        option mode 'ap'
        option ssid 'KTSISB'
        option encryption 'sae-mixed'
        option key 'secret'
        option ieee80211r '1'
        option ft_over_ds '0'
        option ocv '0'
        option network 'lan'

root@OpenWrt:~# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'
        option filter_aaaa '0'
        option filter_a '0'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

root@OpenWrt:~# cat /etc/config/firewall

config defaults
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option synflood_protect '1'

config zone
        option name 'lan'
        list network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

config zone
        option name 'wan'
        list network 'wan'
        list network 'wan6'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config forwarding
        option src 'wan'
        option dest 'lan'

root@OpenWrt:~# ```

The physical connectivity issues are likely at fault here. I'd recommend trying a different, known good cable (even though you said you used the same cable in 2 locations, it's possible the cable is marginal and that the equipment on the other end is not happy with it). Also inspect the physical ports on both devices for any bent pins or debris.

Finally, if those don't work, you can try putting an unmanaged switch between the two devices -- this may 'buffer' the ethernet connection if there is some sort of compatibility/compliance issue between the two devices at the physical layer (L1). At the very least, you should not see the daemon.notice netifd: Network device 'wan' link is down message in the logs, and you may also be able to see if the link is flapping between the modem and the unmanaged switch.