I can't access LAN devices but I can access Internet

Hi,
I have raspberry pi zero w. I transformed it into USB internet gadget by installing and enabling g_eth and dwc2 modules. I also added dtoverlay=dwc2 line at the end of the /boot/config.txt file. Finally, I added ifname "usb0" line to lan interface description. My /etc/config/network file is as follows:


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

config globals 'globals'
	option ula_prefix 'fd4c:481d:6483::/48'

config interface 'lan'
	option type 'bridge'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.1.3'
	option ifname 'usb0'

config interface 'wwan'
	option proto 'dhcp'

When I connect this gadget to my PC it lets me access internet. It also lets me access LUCI page on 192.168.1.3. It, however, do not let me access another devices in this same LAN. For example, I can't access neither 192.168.1.1 (my main router) nor 192.168.1.2 (my second router). I can't even ping them (ping freezes). From raspberry pi, on the other hand, I can ping 192.168.1.1 but I can't ping 192.168.1.2 (I'm connecting throught the serial console).

When connected to my main router I can access both 192.168.1.1 and 192.168.1.2, but I can't access 192.168.1.3. Ping also freezes on this address.

How should I configure OpenWrt to be able to access LAN throught my gadget and my gadget's LUCI page from LAN.

Collect the diagnostics and post it to pastebin.com redacting the private parts:

ubus call system board; uci show network; uci show wireless; uci show firewall; \
ip address show; ip route show table all; ip rule show; iptables-save -c

Here it is:

1 Like

Unfortunately it doesn't work like that, so you have the following options:

  • Configure different subnets on each interface in the router mode.
  • Set up the WDS/relay if you need the same subnet.

I configured relay and now I can access another devices in LAN from PC connected via my gadget. Still, however, it doesn't let me access 192.168.1.3 (LUCI page) from external network (when I am connected to the main router).