VPNMiddleware is doing http requests through (port forward) WR1043nd to Oceandigits. But there is no response.
I solved the issue with Masquerading LAN (according to https://oldwiki.archive.openwrt.org/doc/uci/firewall
Masquerading on lan) on WR1043nd (only for 192.168.100) but it had a (too) bad impact on the green network. (Too bad means it broke requests from other servers (within the green network) to oceandigits, which I did not understand)
Is there any other intelligent way to get the responses from Oceandigits back to WR1043ND if the according request comes from there? Something like setting the "default gateway" on Oceandigits depending on the origin of the incoming connections?
My fear is that your setup is not going to work. You cannot specify two default gateways, unless you have dual wan router. I have changed the network topology, so it can work for you. The TL-WR1043ND when running Openwrt is capable of Multi wan interfaces. You can setup mwan3 package - dual wan with either ethernet ports or a wireless client.
If you can make extroot on TL-WR1043ND, you can install openvpn aside of the mwan3 and run either openvpn client or server and save the raspberry pi for later:
Sorry for the bad images, but I think you may get my idea anyway.
Thank you for the response. I am afraid that the outlook is that bad. Maybe I need to step back and rethink the whole idea.
The overall goal of WR1043ND was to use it as a hardware firewall between the VPN inbound network and the internal network. Is this possible in general? Should I set up the firewall WAN as unmanaged and do it totally different? I wanted to treat the VPN inbound network as a WAN zone, like an internet zone and separate it completely secure from the internal network.
Maybe I'm missing something, but this seems to be a "straightforward" routing/firewall application.
Only NAT when packets leave your control and need to cross the open Internet (assuming you don't need to "hide" your own hosts' IP addresses from each other, as you can control cross-subnet connectivity with firewall rules at the routers). From your diagram, that is the r7800vpn unit.
Within connected networks under your control (looks like everything in that diagram), route between subnets and control access with firewalls.
NAT is not a firewall! (Even though some people use it as one.)
Basically, in what looks to be a "tree" topology, you need to provide static routes on every router for "deeper" networks and a default route by the "upstream" router.
As I understand your diagram:
r7800vpn
Default route assumed to be over the VPN
Implicit route to 192.168.5.0/24 through configuration of WLAN interface
Needs static routes via 192.168.5.101 for
192.168.44.0/24
192.168.4.0/24
192.168.1.0/24
Raspi
Default route via 192.168.5.1
Implicit route to 192.168.5.0/24 through configuration of WLAN interface
Implicit route to 192.168.44.0/24 through configuration of LAN interface
Needs static routes via 192.168.44.4 for
192.168.4.0/24
192.168.1.0/24
Wr1043nd
Default route via 192.168.44.100
Implicit route to 192.168.44.0/24 through configuration of WAN interface
Implicit route to 192.168.4.0/24 through configuration of WLAN interface
Needs static routes via 192.168.4.100 (as pointed out by @Frood42) for
192.168.1.0/24
Oceandigits
Default route via 192.168.4.1
Implicit route to 192.168.4.0/24 through configuration of WLAN interface
Implicit route to 192.168.1.0/24 through configuration of LAN interface
Control "who can talk to whom" with firewall rules at each router.
So now you'll need to figure out the "rules" for what the Oceandigits is going to do with outgoing packets. Now that you've got two routes to all "rest of world" addresses, things get complicated. Often this is resolved by having a "single" gateway (in quotes as it is often implemented with two or more devices that are aware of each other's state and can provide redundancy). Without knowledge of the state of through which gateway the packet came from, with NAT and a VPN in play, it's a rather challenging problem.
1.2.3.4 sends a packet to one of your two public interfaces. It makes it to some host somewhere. That host then sends a return packet based on the 1.2.3.4 address. There's just not enough information there for that host, or any of your routers, to know which path to take. Even if you rigged up something at your border that said, "If this isn't an established connection, send it to the other router", you've still got to figure out how to deal with new connections outbound from your hosts. Easier for TCP than for other protocols, but quite a challenge to keep the packet from bouncing from border router to border router until it times out.
Then again, if it doesn't matter that packets that came in over VPN return over VPN and vice versa, there is nothing that says that a packet has to take the same path on return.
If your VPN is a "pipe" to a known subnet (such as office-to-office connectivity), as opposed to the general Internet, then you probably can use the destination to properly select the gateway.
yes, yesterday, I re-imaged everything and set it up freshly and separated another issue:
It is related to non VPN and VPN connections which stop working as soon as 192.168.44.4 gets connected to Raspi VPN middleware.
It breaks my head... I really need to get this setup working.
With LAN masquerading on r7800vpn it starts working, but it breaks the existing home network...
I think I need to try the SNAT IP rewrite, but this is double head breaking...
And even worse to "fix" a year from now when it breaks. IP rewriting, at least as far as I'm concerned, is to be avoided in most every situation that it can be.
I'd take some time to figure out your subnets, all of them, and the transport you want between them and between them and the rest of the world. At least from here it seems like you've thrown hardware at a problem for which the objective isn't completely clear in all its details.
Routing, taken on a step-by-step basis is very straightforward, especially as it works on a step-by-step basis.
This goes beyond my imagination, but it works - on WR1043ND LAN
If it is totally restricted to the two neighbor subnets - it should not break the other subnets. Especially not the Main Network --> Oceandigits, which is the heart control center of this home. Lets see...
Haha! Doing the LAN masquerading on both, R7800 and WR1043ND makes the setup working.
The change / clean solution today ist your routing rules, that do make much more sense now.