I would like to configure an OpenWRT router for use in a remote location. Ideally, I would like to get it all configured and set up here at home, so when I travel to the remote location I can set it up there with a minimum of fuss.
Specific items:
Wifi
DHCP
DDNS (I have a domain name at Cloudflare ready for use @ the remote location)
Wireguard / VPN
My initial idea, which isn’t working:
My home router, call it Router1, is set up at 192.168.1.1.
I had thought I might set up the new router, call it Router2, at 192.168.2.1, to avoid conflicts
then just connect Router2 to my home network somewhere behind Router1 and ideally configure it via the web interface / ssh to 192.168.2.1
I’ve used a laptop directly connected to Router2 and have the IP set to 192.168.2.1, and can ping it and access it successfully from that laptop. I did go ahead and turn off DHCP on Router2. But then once I connect Router2 to the network behind Router1, I can no longer ping or connect to Router2.
Assuming that you're reconfiguring this device for deployment at another location (independent of your current network), you'll want DHCP to remain enabled on both devices.
It sounds like you had a good start -- connect router 2 via its wan port to router 1's lan port and change the lan IP of router 2 to 192.168.2.1. These are the right initial steps.
To regain access, simply set your computer to a static IP address (such as 192.168.2.15 with subnet mask 255.255.255.0), and then connect the computer to the lan port of router 2. At that point, you should be able to reach the router (192.168.2.1) via ssh or LuCI web interface. You can re-enable the DHCP server and then continue configuring the device.
Why do I need to set computer to a static IP? It currently has a dynamic IP of 192.168.1.x. I don’t speak IP very well, is it true that a 1.x IP can’t communicate do a 2.x IP address?
I have tried connecting Router2 via its WAN port and also via one of its LAN ports. Neither is giving success right now. Are you suggesting connecting Router1-LAN to Router2-WAN, then also Computer to Router2-LAN? I assumed, much like a switch, if I connected them Lan to Lan I could ping / communicate successfully.
I had laptop with ethernet cable connected to Router2 LAN port. Router initially was at 192.168.1.1, and I was able to use Luci to change it to x.x.2.1.
At that point, I had attempted to disconnect from laptop, and plug Router2 into a lan port downstream of Router1, thinking that things should be happily deconflicted. I tried both Router2 WAN and LAN, but in neither case could I then ping/connect from my desktop (which has a x.x.1.x IP address)
If I then disconnect from the Router1 Lan, and back directly connected to laptop, the laptop can happily communicate via Luci and ssh to the 192.168.2.1 IP address
The way you'll want things connected is pretty simple:
Internet > wan port | Router 1 | lan port > wan port | Router 2 | lan port > laptop
As long as you've still got the DHCP servers running on both devices, your laptop should get an IP from router 2, and router 2 should get an address from router 1... you should be able to connect to router 2 at address 192.168.2.1, and you should also have Internet connectivity.
If the desktop is connected to router 1, router 2 will not be reachable (in terms of administrative access) without a bit of additional work one or both of the routers. It can be done, but this would be stuff you'd need to undo later because of the ultimate goal for router 2 (leaving those changes in place would present a massive security issue when deployed at the new location).
Lol, well I’ve gone backwards. I think because I had turned off DHCP in Router2, now I can’t connect to it at all, even back to just laptop-to-Router2Lan. Router isn’t giving out IP addresses, so computer gives itself a 169.254.x.x address….
Since you turned off DHCP, the computer is unable to obtain an address... so you need to set one manually, then you can regain access to the router and re-enable DHCP.
Ok, we’re good, it’s working again. I had to set a static IP address long enough to get back to the orphaned router and awaken it’s DHCP, then get rid of static IP, and all is right with the world. The laptop can see Router2 at .2.1 and also the rest of the network at .1.1 and also the internet.
I have copied the final configuration for completeness. This issue can be marked as Solved.
Again, my understanding of how subnet masks and IP addresses play together is imperfect, but I really thought just setting the router(s) lan interfaces to a subnet mask of 255.255.0.0 would fix things. It did not (yes I tried it).
each routed network needs to be unique and non-overlapping. Adjusting the subnet mask to a /16 basically makes one very large network which breaks the routing between the two subnets you're working with (192.168.1.0/24 and 192.168.2.0/24).
If you are trying to preconfigure your 2nd router for deployment in another location, the best way to do this is to have your computer connected to the 2nd router's lan and perform all the configurations there. This way you're not altering things like the firewall in ways that would need to be reverted later.