I have a device, the target device in the diagram, running a website providing service through HTTPS (and HTTP is necessary too for TLS certificate renewal) and also providing samba service for internal use.
The device is attached to the router A which is provided by the ISP to connect to the internet by optical fiber.
And all my other devices are attached to Router B as a sub LAN. Router B is connected to router A. I use router B to provide WiFi.
Both routers A and B are providing DHCP services.
I want to access the website on my Target Device both from the sub LAN managed by router B (②), and the devices in the internet (①), and access the samba provided by the target device from only the sub LAN (③).
How can I implement this?
I think I can configure the port forwarding on Router A to let the device with internet access the website (①), but I have no idea how I can make the target device reachable from the sub LAN (② and ③).
I know I can attach the target device to router B and configure the port forwarding on both Router A and B. But the problem is that my router B don't have enough LAN port for the target device and I don't want a wireless connection which is much slower than LAN cable since it is a server. So this is not currently an acceptable solution in my case.
I also know that I could set router B to AP mode (I am not sure whether this is the term I should use) that could merge the two LANs into one, and every device gets IP from router A's DHCP. But the router A only supports a limited number of devices and I have much more devices. So this is also not a good solution in my case. 😫
EDIT: my final solution
Well, I haven't really solved this problem, but found a way to bypass the problem.
I found a device attached to Router B that I haven't used it for more than 1 year. So I removed the device and got a spare port for the Target Device.
Now, I just set the port forwarding for HTTP/HTTPS on both Router A and Router B and give the Target Device a fixed IP in DHCP settings on Router B. Then done. Everything works like expect.
Furthermore, I also have some internal domain name, but my Router B don't support a custom DNS record, so I just set them on Router A.
This is the diagram.