I configured my router with openwrt 21.02.01 using OpenWRT Invasion and used a lan port on my isp's router to connect the xiaomi router to use internet and it did not work.
The ip of the isp router is (192.168.1.1) and the ip of the xiaomi router is (192.168.2.1).
The xiaomi router has two radios (2.4g and 5g) with a wan port and two lan ports.
uci set network.lan.ipaddr="192.168.2.1"
uci commit network
/etc/init.d/network restart
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 packet_steering '1'
option ula_prefix 'fd5c:2a3e:9be6::/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 '192.168.2.1'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
root@OpenWrt:~#
I tried to ping 1.1.1.1 (cloudflare DNS) and this is the result.
BusyBox v1.33.1 (2021-10-24 09:01:35 UTC) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 21.02.1, r16325-88151b8303
-----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
ping: sendto: Network unreachable
I uploaded the sysupgrade file and connected to the router. It gave me an internet connection for around 30 sec (It happened the first time I booted openwrt) through ethernet and it does not work again.
should I flash the stock firmware and try to install openwrt again ?
btw, it is the global version
root@OpenWrt:/etc/config# cat 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 'fda3:1de9:00c3::/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 ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
root@OpenWrt:/etc/config#
I used the custom pxe server and flashed the global version of the stock firmware on windows 10 and used kali linux with openwrt invasion to flash openwrt 21.02.2 (I verified the sha256sum).
BusyBox v1.33.2 (2022-02-16 20:29:10 UTC) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 21.02.2, r16495-bf0c965af0
-----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
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 packet_steering '1'
option ula_prefix 'fd9e:2370:f9d8::/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 ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
root@OpenWrt:~#
I think I have an internet connection because I can ping 1.1.1.1 and use the LuCI interface and ping openwrt (I did not change the ip to 192.168.2.1)
PING openwrt.org (139.59.209.225): 56 data bytes
64 bytes from 139.59.209.225: seq=0 ttl=52 time=186.429 ms
64 bytes from 139.59.209.225: seq=1 ttl=52 time=166.916 ms
64 bytes from 139.59.209.225: seq=2 ttl=52 time=152.740 ms
64 bytes from 139.59.209.225: seq=3 ttl=52 time=147.115 ms
--- openwrt.org ping statistics ---
5 packets transmitted, 4 packets received, 20% packet loss
round-trip min/avg/max = 147.115/163.300/186.429 ms
Apart from LAN IP address, and high ping times to openwrt.org, the LuCI image looks OK to me.
The /etc/config/network is missing MAC addresses for WAN and LAN interfaces.
Update
I just flashed 21.02.1 onto a R4AG and the file contents is same as yours. No MAC address definitions for LAN or WAN interfaces. I don't know if this is considered normal for a DSA device.
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 'fd37:a39e:71ed::/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 ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
fwiw, I loaded snapshot for HH5a which uses DSA, and I see these extra lines for the LAN interface
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config device
option name 'lan1'
option macaddr '10:d7:b0:45:7f:f0'
config device
option name 'lan2'
option macaddr '10:d7:b0:45:7f:f0'
config device
option name 'lan3'
option macaddr '10:d7:b0:45:7f:f0'
config device
option name 'lan4'
option macaddr '10:d7:b0:45:7f:f0'
No I would not use snapshot at this time unless you wish to fix a problem. (HH5a 21.02 does not use DSA, which is why I had to install snapshot which uses DSA)
Power off and on the R4AG and just check the MAC addresses reported in LuCI remain unchanged between reboots.
If the MAC addresses were changing, surely other R4AG users would have reported it as a bug?
It is possible those sections defining MAC addresses are not required for MT76 devices, such as the R4AG? I do not know for sure.
edit - I changed the ip to 192.168.2.1 and it seems to be working but when I type (192.168.1.1) the url changes to a openwrt link. is there any way to stop it ?
(I want the ip to access my isp router because I can't change the ip in that router)