Hi,
Thanks for a great forum! I am a complete newbie, so it has been really helpful to be able to read up on things.
My router with openwrt doesn’t have a SIM card slot, so I need to use another router (hereafter “main router”) for the internet connection.
Setup:
“Main router” - 192.168.1.1
“openwrt router” - 192.168.2.1 (main router connected via WAN port)
all devices connected via WiFi to “open wrt router”
I have set static IP on all devices and I’m pretty sure that worked when I had a VPN interface I forced all traffic through. But since I removed that interface and sent all traffic straight to the WAN, it seems like the devices no longer use their static IPs (192.168.2.x) but rather a dynamic IP from the “main router” (192.168.1.x).
This creates an array of issues with my home automation, so I would be very happy for any insights on how to fix it. Thanks
All devices connected to openwrt will use the wan address of openwrt since masquerading is enabled by default. It is possible to disable it but then the main router needs a static route to the 192.168.2.0/24 network and it also has to allow traffic from that network to the Internet. Unfortunately not all home routers support such configuration.
Okey, thanks. And the reason it worked with the VPN is because the tunnel is established between the server and the openwrt router, so the only traffic the main router sees is the encrypted tunnel?
I will in a few months get broadband, so then I won’t have the need for the “main router”. But it would be ideal to have set up everything by then so it is just to switch the WAN cable.
But basically: I have no other options than what you suggest?
I have a “Mac clone” option in the main router, but not sure what that means.
Thanks!
Edit:
these are the available menu items in the main router
Edit 2:
Can I have the openwrt router on 192.168.1.x? I guess the devices won't ask the openwrt router for an IP then...?
I am not sure I understand. If the IP address is statically set on a device (opposed to a static lease by the server), then the device can't on its own choose to work on a different IP given by a DHCP server. It will not request an IP, and it can't even talk with the main router, as it's on a different subnet (unless you are using a subnet mask of 255.255.0.0 (or something less than 255.255.255.0 anyway).
Well, subnet mask of 255.255.0.0 basically means that 192.168.1.1 and 192.168.2.1 are on the same network. So you have incorrect setup for your OpenWrt router, as you have both LAN and WAN interface s on the same subnet, which won't work unless you disable NAT.
OK, I am not sure what exactly your requirements are, if you need to have the clients of OpenWrt able to access the clients of the main router (and the otherway around) or not. Presuming that you don't need that and you are fine with letting OpenWrt make its subnet, the simple setup slyly be as follows:
1- Main router on whatever IP, subnet mask 255.255.255.0
2- OpenWrt WAN connected to main router LAN as DHCP client.
3- OpenWrt LAN is set to an IP on a different subnet.
4- OpenWrt clients are DHCP clients or have static IPs or static leases on the same subnet as OpenWrt.
That should be fine, if you have the routers connected LAN to WAN and you haven't changed anything in OpenWrt. It shouldn't matter if the clients are DHCP clients or static leases.
That's, again, presuming you didn't change something significant in OpenWrt.
If, for example, you bridged WAN and LAN then this changes everything.
Maybe you should share with us the output of the following commands on OpenWrt. Please redact MAC addresses and any passwords.
cat /etc/config/network
cat /etc/config/dhcp
Edit:
Please use the Pre-formatted text tool </> to include the code here
I just realized I don't want to reset, since I don't have an ethernet port on my computer =) Any ideas on how to reset without resetting the wifi-networks?
Please refrain from telling the forum you've made changes until you've actually done so. We rely on the OP to tell the truth.
Anyways, 192.168.1.0 and 2.0 should no longer be on the same network...as long as you fixed the subnet mask on the upstream device too.
You are aware that this setting makes providing a static name useless for clients receiving the lease, except for your convenience when looking at the web GUI.
The only fix is to:
disable masquerade on the OpenWrt WAN
on the upstream router, make a static route for toward it's LAN (both configs below mean the same thing - I provide both because I don't know how your upstream router shows the config):
192.168.2.0 mask 255.255.255.0 via 192.168.1.x (WAN IP of OpenWrt) on LAN; or
192.168.2.0/24 via 192.168.1.x (WAN IP of OpenWrt) on LAN
It seems like I don’t have the possibility to set up static routes on the upstream router. I guess that is a dead end then? I read other people writing about “bridge mode” using “dmz”, but I know to little if that maps into this at all.