I am trying to set up my OpenWrt 18.6 Archer C7 as access point by connecting its LAN port to a LAN port of the main router.
IP of OpenWrt is set to 192.168.1.2, with DHCP disabled. Main router is 192.168.1.1.
I can access internet form PC via OpenWrt AP, but I can't ping from LuCi, and I can't download packages vi SSH.
root@OpenWrt:~# ip -4 a; ip -4 r
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
11: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
inet 192.168.1.2/24 brd 192.168.1.255 scope global br-lan
valid_lft forever preferred_lft forever
default via 192.168.1.1 dev br-lan
192.168.1.0/24 dev br-lan scope link src 192.168.1.2
root@OpenWrt:~# head -n -0 /etc/resolv.conf /tmp/resolv.conf.auto
==> /etc/resolv.conf <==
search lan
nameserver 127.0.0.1
==> /tmp/resolv.conf.auto <==
# Interface lan
nameserver 192.168.1.1
root@OpenWrt:~# traceroute openwrt.org
traceroute: bad address 'openwrt.org'
I just realized that I cannot ping 192.168.1.1 from OpenWrt either!!
Before flashing, I tried soft factory resetting as below. The result is that new setting (e.g. SSID and security) weren't saved after I restart. It made me doubt that I forgot to apply the settings before restarting (PC is away from the main router, so I have to keep moving OpenWrt router over when I need to connect with a cable). Anyway, after few times of applying the settings and losing thme after restarting, I just re-flashed (it's the same version I had actually, except that I used sysupgrade copy of course).
umount /overlay && firstboot && reboot
Anyway, after re-flashing, the problem of the OpenWrt router has no internet connection and not being able to ping the main router form LuCI (LAN to LAN connection), even though I can access internet when connected to OpenWrt AP! I also tried a cross-over cable, thinking that maybe one of the two router isn't smart enough to recognize that at the other side it's a router not a terminal, but that didn't seem to make a difference.
So I had to connect the cable to OpenWrt via WAN (still DHCP client, different subnet though) in order to download the packages I wanted to download. But that's not an ideal situation for two reasons:
1- I wanted both router to be on the same subset for convenience.
2- I wanted OpenWrt WAN to be configured for my PPPoE, for easy swap when the other router if and when I need to do so.
Assuming that firewall is not involved, addressing, routing and resolver looks fine, so I'd make a guess the issue is somewhere deeper than network layer at least.
@vgaetera I played with the different settings of the firewall, but it should be straight forward, as far as I understand. They are all on the same VLAN1 and in the same zone. Moreover, I could ping 192.168.1.1 when I am connected via WAN port (DHCP client, 192.168.2.2), so how can't I ping it when it's the same interface and same subnet?
To make it even more interesting, I could access LuCI when I am connected to main router AP (when they are connected LAN to LAN), and I could access internet when I am connected on OpenWrt AP.
Thanks @vgaetera. That did the trick! Changed MAC address of OpenWrt LAN, and now OpenWrt has access.
Then with further investigation, it looks like a static IP lease for the OpenWrt LAN MAC address in the main router interface (was there from previous trials) was causing the problem. So reverting OpenWrt MAC to its original address and removing the static IP lease entry from main router solved the issue.