Can't reach router's IP internally sometimes after restart, but external IP

Hi all!

Since upgrading from OpenWrt 22.03.5 to 23.05.2 I have the following problem:
after restarting my Router (Xiaomi Mi Router 4A Gigabit Edition) I can't reach my router with the IP address 192.168.1.1 (pinging also doesn't work). When I run the command "ipconfig" on my PC the IPV4 address shown is my external IP from the MODEM (my network providers Router in bridge mode).

After some (random) restarts the router's IP is reachable again and the "ipconfig" command shows a logical IPV4 address (inside my 192.168.1.x network).

Because I am not very familiar with computer networks this could also be a wrong setup from myself (settings are attached as screenshot).
Here you can see a screenshot of the right ipconfig output on the top and the wrong outputs after a restart at the bottom and my OpenWrt network settings:


(now more censored)

What can cause that kind of problem and how can I solve that?

I would be glad for any help!

What happens if you shut down both and restart the modem first?

And what is the wireless device you have in your br-wan interface?

And what is up with all your interfaces having the same MAC address? Same thing with the devices.

Hi, thanks for your reply.

I tried to restart the router only (while the modem is still powered on) and then the problem still occurs. So this case should already be tested?

Which wireless device do you mean?
I think the censored ending of the MAC address is different, but I can't look that up, because I can't reach LUCI because of the error described...

I meant turn them both off but let the ISP modem/router load first.
And what is the wireless device in your wan (br-lan)

Look at the screenshot of devices (the last one) notice the unredacted MAC addresses share two MAC addresses; only one is unique.

search this forum for wan port leak, could be related.

1 Like

@LilRedDog raised a very important question here:

There shouldn't be a bridge, and there shouldn't be a WiFi attached to it.

Are you connected via WiFi to your router or via cable? If it's via cable, then it could be a WAN port link, as suggested by @frollic. If you're connected via WiFi, then your configuration is wrong.

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

I tried letting the modem fully boot and the booting the router which solved the issue. Could also be coincidence...

Thanks for your help!
I am connected via WIFI from my PC to my router...

My output of "ubus call system board" is:

{
        "kernel": "5.15.137",
        "hostname": "OpenWrt",
        "system": "MediaTek MT7621 ver:1 eco:3",
        "model": "Xiaomi Mi Router 4A Gigabit Edition",
        "board_name": "xiaomi,mi-router-4a-gigabit",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.2",
                "revision": "r23630-842932a63d",
                "target": "ramips/mt7621",
                "description": "OpenWrt 23.05.2 r23630-842932a63d"
        }
}

"cat /etc/config/network":

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

config globals 'globals'
        option packet_steering '1'
        option ula_prefix 'fd7e:xxxx:xxxx::/48'

config interface 'lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option device 'br-lan'

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

config interface 'wan6'
        option proto 'dhcpv6'
        option device 'br-wan6'
        option reqaddress 'try'
        option reqprefix 'auto'

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

config device
        option name 'br-wan'
        option type 'bridge'
        list ports 'wan'

config device
        option name 'br-wan6'
        option type 'bridge'
        list ports 'wan'

and "cat /etc/config/wireless":

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11g'
        option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0'
        option htmode 'HT40'
        option channel 'auto'
        option cell_density '0'
        option txpower '18'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11a'
        option path '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
        option htmode 'VHT80'
        option channel 'auto'
        option cell_density '0'
        option txpower '18'

config wifi-iface 'wifinet0'
        option encryption 'psk2'
        option device 'radio0'
        option mode 'ap'
        option network 'wan lan'
        option ssid 'XXXXXXXXXXX'
        option key 'xxxxxxxxx'

config wifi-iface 'wifinet1'
        option encryption 'psk2'
        option device 'radio1'
        option mode 'ap'
        option network 'wan lan'
        option ssid 'XXXXXXXXXXX 5GHz'
        option key 'xxxxxxxxx'

I don’t see it that way.

This is wrong (two times). It has to be only in lan, otherwise you're getting these unexpected results. Afterwards, you can remove the br-wan bridges and use the wan port directly.

EDIT: My bad, it needs to be in lan, not in wan.

2 Likes

You have 2 radios: phy0-ap0 and phy1-apo.

Which one connects you to the Isp device?
And unplug the ethernet cord that was, also, in the wan interface.

As far as I've understood, he's connected via cable to the ISP router. The two WiFi interfaces are for 2.4Ghz and for 5GHz.

Yep, I misread that,

Ok, I should definitely deepen my network knowledge...

In "/etc/config/wireless" I set both option network 'wan lan' to option network 'wan' and in "/etc/config/network" I removed all "br-xx" devices.
Now I can't reach my router and have no Internet access any more...
What went wrong?

That's right!

You removed your wan interface. Try rebooting it.

You can still connect to its wifi, right?

If you removed all br-xx interfaces, including br-lan, you just removed your LAN port and thus lost access to your device. If WiFi doesn't work (which I assume), your easiest option, if you don't have a backup, is to reset it to defaults and configure it from scratch.

When doing so, remember that the WiFi interfaces need to be in the lan zone only!

Ok you definitely wrote "remove the br-wan devices", that was very dumb removing all of them...
Yes nothing works anymore... I have a OpenWrt ".tar.gz" backup file, how can I resore the backup without SSH access?

You need to put your router into failsafe mode by pressing any button (e.g. the reset button) when it starts blinking fast during boot. When you are successful, it blinks even faster - now you are in failsafe mode.

You can now connect via Ethernet cable to your router at 192.168.1.1 using SSH. Edit your /etc/config/network file to add back the br-lan interface based on either your backup file or the one you posted above.

However, if you've never done this, it might be easier to restore defaults and upload your backup to restore its settings.

When you hit save, it started a 90 second countdown, if it never heard from you in the 90 seconds it would offer you an option to revert.

Obviously, you got impatient and manually disconnected, but it still would have timed out and should revert if you reboot it.

Did you use LuCI to make the changes?

1 Like