My network environment is shown in the following image:
I have route settings correctly. (able to ping the printer, and SNMP works properly. captured using wireshark).
But when I send a document from PC1 to the printer, nothing happened. It seems to unable to get any responses from the printer.
Any idea how to make the printer work in this situation?
you have a double NAT setup
I think it would be better to make the openwrt router into a dump access point / switch
this would mean they are all on the 192.168.1.1 network
you could keep the 2nd subnet but you need to make sure you are not using NAT
and add routing in the main router for the 192.168.2.1 subnet return
Is it possible to make it work via setting either firewall or port forwarding?
I've tried several settings and none of them worked. Not quite sure if it was the settings were incorrect or if it is impossible to work in this kind of network environment.
ok I think you want the separation
in openwrt change the wan interface firewall setting to LAN
it should go green
on the office router add a static route for subnet 192.168.2.x
to what ever 192.168.1.x address is on the old wan interface of openwrt "do make this static"
now they should all able to ping and talk to each other
do note no broadcast data will cross subnets
The OP noted that they "have route settings correctly"
Another poster proceeded to say "you have a double NAT setup" and suggested a dumb AP config instead - from the OP's description it seems they had a routed setup, not double NAT
Both shouldn't be true
Can we see the configs (network and firewall) to verify - particularly the route you created for 192.168.2.0/24 via lan src 192.168.1.x.
Assuming 192.168.2.1/24 uses 192.168.1.1/24 as upstream wan.
I don't think a extra forward rule is needed as the default zone rule for lan does forward to wan anyway.
So i think you may have to play with the dhcp settings a little, im suspecting rebind protection discarding upstream local addresses or a similar setting in dhcp.
Could you show us the firewall configuration and dhcp?
Finally, I got the printer to work. And yes, you are right about the routing.
It is weird I added V4 static route in Openwrt which was assigned from the office LAN (192.168.1.254). But with this route, the ack packets were unable to send/receive correctly.
Anyhow, with the correct routing table (removed the route I added), everything works fine.