192.168.1.1 and 192.168.2.1 and a couple other questions

if my main router uses 192.168.1.1, am i safe to use 192.168.2.1 on my secondary router, currently i have primary on 10.10.1.1 and secondary on 192.168.2.1 not sure if this is ok

(i will be double nat until i can setup a static route or a dmz or some other setup)
i want to keep the first router (family router, unmodified stock firmware)

how would i setup a static route using the above info? i hear thats the easiest way to get out of double nat but maintain the layout as is

Sure, assuming they are both on /24 subnets (or even /23). Before writing a big explanation, I just did a search and found this calculator, https://jodies.de/ipcalc?host=192.168.1.1&mask1=24, which should help you figure out how they interact. Try different masks/CIDRs and look specifically at the HostMin and HostMax values to see whether a specific address is on one subnet or another (or if the networks overlap).

Static routes can be set on the "supernet" router. Here's a config that routes from my main lan on 10.1.1.0/24 to the 192.168.1.0/24 subnet via the wan address of my subnet router which is at 10.1.1.20. In LuCI, it's in Network -> Routing -> Static IPv4 Routes.

config route
        option interface 'lan'
        option target '192.168.1.0/24'
        option gateway '10.1.1.20'
1 Like

so my main router is a linksys wrt3200acm, running stock firmware, the /24 is the 255.255.255.0? if thats a dumb question i apologise

in my scenario, is the supernet the linksys?

1 Like

Yup, "gateway" or "edge" router is more common term, it's the one that connects to the internet.

Here's a fake example, main lan on 10.1.1.0/24, subnet router's wan address is .20 and lan space is 192.168.1.0/24. That route I give above allows, e.g., ws1 to talk to the NAS directly, as anything going to the edge router on 192.168.1.0/24 is directed to 10.1.1.20.

         internet/ISP
               |
      wan 20.30.40.50 (made up)
             edge router
       lan 10.1.1.0/24 network
      /           |           \
10.1.1.19     10.1.1.20     10.1.1.224  ... other devices
    ws1      subnet router      ws2
             192.168.1.0/24
            /             \ 
      192.168.1.22    192.168.1.34   ...  other devices
           NAS            ws3

As long as the two subnet ranges don't overlap, everything will work fine.

1 Like

and it is okay for both routers to be "routing" i dont need to disable anything or change anything on my secondary router correct, in this scenario its family router / test/learning lab

Well, you will need to open up the firewall on the subnet router to allow access from "outside" (by which I mean all the 10.1.1.0/24 devices). By default, my comment about "ws1 talk to NAS" is sort of a lie and will be blocked, unless it's the NAS that initiates the contact, because OpenWrt is set up to block incoming traffic.

In the above scenario, let's say that you want to allow ws1 to access the media server on the NAS at, say, port 8384. You could add a firewall rule on the subnet router to allow this, it would look something like

config rule
        option name 'NAS-media-server'
        option src 'wan'
        option dest_port '8384'
        option target 'ACCEPT'
        option dest '*'
        list src_ip '10.1.1.19'
        list dest_ip '192.168.1.22'

This tells the OpenWrt subnet to allow that specific host onto the subnet lan, but only for that specific host and that specific port.

If you want to allow anything in the 10.1.1.0/24 network into anything on 192.168.1.0/24, then you could just change the firewall config on the wan zone to accept everything ("The Wild West", and you don't learn much about firewalling that way :grinning:). In LuCI, go to Network -> Firewall and look at the "Zones" down at the bottom of the page, you'll see the default overarching rules that we just punched a little hole through with that NAS-media-server rule.

1 Like

thank you for all the advice! i appreciate you!