Confused re: subnets

Associate
Joined
4 Oct 2021
Posts
160
Location
Uk
Hi

I am trying to do somethign in my home network.
I have just got hold of a 4g router so I can have some sort of backup when cityfiber decide they want to shut me down.
the problem is, whenever i set the IP of the 4g router to anything in the 192.168.0 or 192.168.1 i just cant seem to be able to access it, so i am stuck with it on 192.168.32.1


now, how do i access this page from my desktop? 192.168.0. addresss?
 
You might be better off getting a new router with dual WAN, so one for your main connection, and then plug the 4G router into that, assuming it supports bridge mode. That way it will also automatically fall back to the 4G connection if the main connection fails, or maybe even use the two together.
 
You might be better off getting a new router with dual WAN, so one for your main connection, and then plug the 4G router into that, assuming it supports bridge mode. That way it will also automatically fall back to the 4G connection if the main connection fails, or maybe even use the two together.
I'm running opnsense and have two gateways in a group, main one being tier1 and the backup being tier2, and offline mode being the thing what initiates a switchover.
My router is overkill for what I use it for.

It's just understanding subnets..I don't get it.


I know in windows I have set a static IP and then used subnet 255.255.254.0 so I can access 192.168.1.x addresses.

Windows pulls an error when I set it to 255.255.220.0
 
I don't know..I read somewhere that that's how you access other subnets in your network

.1 subnet is for cctv
No, that’s not how it works. I’d suggest reading up on it or watching videos on YouTube.

255.255.255.0 (/24) is what the vast majority of home users will use and should never change unless they know what they are doing.

Your default gateway will route your traffic onto another subnet if it knows about it.
 
Your default gateway will route your traffic onto another subnet if it knows about it.

This. It sounds to me like pfsense isn’t configured to allow traffic to flow between the two subnets.

It also seems that you have both subnets on a single VLAN/physical LAN segment (as you can hit it from your desktop if you switch subnet mask to /23).

Doesn’t sound like you need two subnets at all, just the logic in your router to failover WAN.
 
Assuming your home network is in the 192.168.0.x range, your router/modem will probably be 192.168.0.1 (I'm generalizing here).
This would mean you have access to all the IP addresses in the range 192.168.0.2 to 192.168.0.254. Most devices on your home network will not have static IP addresses, and will just have one allocated to them by your router (DHCP). If I was you, I would set the 4G router to 192.168.0.2 as a starting point, which should then be accessible by any device on your network.

What you need then is a device that will "failover" the default gateway from 192.168.0.1 to 192.168.0.2 in the event your internet goes down. I imagine opnsense is meant to do this, but I can't offer any guidance on that I've never used it.

For the above, if your router is on the 192.168.1.X address range, then the numbers I've used above need to reflect that.

How it should *probably* work is that all your devices use the opnsense device as their default gateway, and opnsense has 2 gateways. The main one being your router/modem and the backup being the 4g box. These can be on seperate subnets as opnsense knows where they are and has the settings to get to them (routing etc).
 
So I just want to be able to access the config page of the 4g router...that is on 192.168.32.x , from my server which is on 192.168.0.x

Most of my devices have static IPs set in opnsense as a lot are smarthome related and they really misbehave with home assistant if IPs keep changing.
 
To access a device on another subnet, you need to route to it.

Presuming your Opnsense box is physical, add another interface and give it an IP address on the 192.168.32.x subnet, say 192.168.32.254. Connect the 4G router into that interface. The Opnsense router will then be aware of the 192.168.32.0 subnet and be able to pass traffic across to it.

To get traffic back from the router into Opnsense, log into the 4G router and add a route to 192.168.0.0/24 with the next hop as 192.168.32.254. This will pass traffic back to Opnsense which will route it back to your server.

You can then set a backup/failover gateway if the primary connection fails, pointing to the 4G router's IP address. No doubt a bit of double natting but it will work.

Windows pulls an error when I set it to 255.255.220.0

Subnetting is calculated to the power of 2. A subnet of 255.255.220.0 is not valid.

A mask of 255.255.224.0 will include 192.168.0.0 to 192.168.31.255
A mask of 255.255.192.0 will include 192.168.0.0 to 192.168.63.255

Setting your server to use a 255.255.192.0 mask may work and allow you to access the 4G router, but it may break other things in the process.
 
Last edited:
Lots of decent pointers and advice already. A router is just a device that joins together two or more networks, so it should 'see' the other subnet and add a route without you needing to do it manually. That said - and I didn't see this yet - make sure OPNSense isn't set to block BOGONS (private IP addresses) on WAN. That will kill your ability to access the other router (or your ISP modem etc) dead.
 
thank you folks ! I get it now.
it seems to be purring along OK on its own without me having to do anything - again, I dont understand why I can access .32.x from my .0.x but i can.
 
Back
Top Bottom