No internet connection in nested router setup

My family has a consumer router as our primary router (192.168.1.0/24 subnet) and I'm looking to connect my openwrt router to it and use it to create a separate lan (192.168.30.0/24 subnet). I've done a fresh install and the openwrt router is connected to the consumer router via ethernet. However regardless if i leave the default ip as 192.168.1.1 or change it with uci set network.lan.ipaddr="192.168.30.1" I can't seem to ping 8.8.8.8. The output of ip addr is as follows:

Edit: The output of

cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp

is as follows. Firewall is disabled.

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 'fddd:028b:b105::/48'

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

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

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '4 5 0'
config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/soc/a000000.wifi'
        option channel '1'
        option band '2g'
        option htmode 'HT20'
        option disabled '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'platform/soc/a800000.wifi'
        option channel '36'
        option band '5g'
        option htmode 'VHT80'
        option disabled '1'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'
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 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'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        option ra_slaac '1'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

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'

Any help is appreciated.

Screen grabs can be hard to read,... in the future...

Please copy/paste and use the "Preformatted text </>" button for logs, scripts, configs and general console output.
grafik
Please edit your post accordingly. Thank you! :slight_smile:

While we're at it...

Please 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:

cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Gotcha, post has been edited.

There is no WAN defined.

What device is this?

ubus call system board
{
        "kernel": "5.10.136",
        "hostname": "OpenWrt",
        "system": "ARMv7 Processor rev 5 (v7l)",
        "model": "Linksys WHW01 v1",
        "board_name": "linksys,whw01-v1",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "SNAPSHOT",
                "revision": "r20306-67efb6a661",
                "target": "ipq40xx/generic",
                "description": "OpenWrt SNAPSHOT r20306-67efb6a661"
        }
}

There are 2 ethernet ports, and it appears that they are both connected to a hardware switch. But it is not entirely clear and at this very moment, the openwrt main site isn't working (so I can't check the details for this device).

What have you changed since the default config? It may be worth resetting to defaults to see if the default config has a pre-defined wan interface.

I've only changed the network.lan.ipaddr value to 192.168.30.1. I've reset it a few times now and tried pinging with default config to no avail. Also I have the openwrt info page for the device pulled up from earlier if you need some info from there.

Seems on the device page no details given. Do you again have access or want a screenshot?

Ok... here are the modifications I am recommending... hopefully this will work as expected.
The idea is that we will put one of the ethernet ports on one VLAN on the switch, and tie that to the LAN, and the other will be on a different VLAN and tied to the WAN.

Before you make any changes here, make sure you are able to connect via wifi to administer the router. Then make the following modifications.

edit the below:

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

add the next section

config interface 'wan'
        option proto 'dhcp'
        option device 'eth0.2'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '5t 0t'

and finally, edit this last bit

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '4t 5 0t'

Then restart your router...
You have 2 ports:

  • one of them should give your computer an address via DHCP -- this will be the LAN
  • the other one will not (it will be a DHCP client) -- this will be the WAN port (for the upstream connection).

Plug your computer into one of the ports and see what happens... then switch to the other port and see what happens. Hopefully that confirms what I said above.

Finally, plug your upstream connection into the WAN port and see what happens.

My config file is as follows after the changes:

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 'fd1c:1b0b:6813::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

config interface 'wan'
        option proto 'dhcp'
        option device 'eth0.2'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '5t 0t'

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

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '4t 5 0t'

You said make sure I can connect via wifi to administer it...I've been accessing the console via serial port as without an ip I have no way of reaching it. Unfortunately after the changes and a reboot neither of the ports seem to be providing internet access. And yes I did a fresh install just in case beforehand.

Ok... serial is fine.

I see two mistakes (both mine from earlier):

Make the switch configuration stanzas look like this:

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '5 0t'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '4 0t'

then reboot and try again.

Same result as before.

Going back a step... You said you were unable to get an IP even when using the default configuration? Can you confirm?

If that's true, I don't have any hope for my configurations above.

Yea, after a fresh install I'm not able to ping anything.

If you are unable to get an IP via DHCP when connected to either of the ethernet ports, I suspect something more serious is wrong with the snapshot image you are using.

It goes without saying, but verify that you have good cables and then connect directly to your computer. Make sure that the computer is set to get an address via DHCP on that interface. If this doesn't work now (with the changes I suggested) and if it doesn't work when you've got a default config, something is wrong and we probably won't be able to solve it here.