Need help setting up multiple subnets (Tried & failed)

Thank you guys for providing the help, I tried and haven't been able to figure it all out, so glad I still learned something, you've been truly amazing!

My hardware is Netgear R7800

What I have right now:

What I want to do:

What I've tried:

  1. New WLAN SSID "Pi";
  2. New interface, static address 10.0.0.1, connected to SSID Pi, IPV4 gateway set to 192.168.1.139, DHCP enabled for subnet 10.0.0.x;
  3. New firewall group for allowing communications from and to "LAN", where 192.168.1.139 belongs.

The problem:

Devices connected to "Pi" don't recognise 10.0.0.1 as network gateway, devices are assigned 10.0.0.x IPs though, and setting manually the network gateway doesn't help either. What did I do wrong?

Thank you!

It is not so clear what are you trying to achieve here.
The RPi is a gateway to what exactly? From the diagram the only gateway is the OpenWrt to the internet. The rest looks like hosts to the OpenWrt lan.

1 Like

Hi Trendy

Sorry, I should've been more clear. The RPI is a gateway to VPN, I have configured the VPN to whitelist lan ip, and have enabled the RPI as a network gateway and it does work when I manually set other devices to use it, currently I'm using that 2nd router to specifically go through the RPI as some devices only supports DHCP, which are connected to the 2nd router.

I'm not at all sure my goal is do-able as it's not a usual dual-wan setup, as part of the subnet serves as a gateway to another subnet, similar to a chained proxy only more complicated I imagine.

Provided that dhcp server here is the OpenWrt, you can use the option 3,192.168.1.139 in advanced settings of the lan interface for dhcp and advertise the RPi as default gateway.
Or if you don't want to do it for every host, you can use tags.

1 Like

I know that advanced settings part which I didn't dare to touch, is that however different from setting the IPV4 gateway in the interface settings? I mean, I put 192.168.1.139 in that interface settings as the 2nd subnet gateway, which didn't work, should I have instead put 10.0.0.1 in there and leave 192.168.1.139 for the advanced settings?

You'll need to route the WIFI2 subnet to 192.x.pi as the next hop (on openwrt). You can't use a gateway that is not in the clients routing tables.

1 Like

Is there any specific way to do that? Or just do I set the gateway and expect it to find the RPI which it didn't?

OK I saw your update, not a gateway issue, so is there somewhere to do what you suggested assuming it isn't too hard to do?

you use policy rules... ( ip route / ip rule ... )

uci set network.route1="route"
uci set network.route1.target="0.0.0.0/0"
uci set network.route1.gateway="192.168.1.139"
uci set network.route1.table="10"
uci set network.rule1="rule"
uci set network.rule1.src="10.0.0.0/24"
uci set network.rule1.lookup="10"
uci commit network
service network restart

something like that... trendy is the master...

1 Like

Thanks, let me try that.

The gateway in the interface settings is for the OpenWrt.
The option 3 gateway is what will be advertised to the dhcp clients.

If you have added a gateway in lan interface, you'd better remove it immediately. OpenWrt should have a gateway from the wan interface already.

1 Like

Thanks man that's really a lot you typed, I had no idea about the depth of the question I have asked, I'll probably try an easy way and report back.