Setup static route from main router to sub router

I have two routers say Router1 and Router2. My Router1(DHCP:192.168.0.1) is connected to my ISP and has a few devices connected to it. Router2(DHCP:192.168.1.1) is connected to the ethernet port on Router1 with IP address 192.168.0.5 with respect to Router1. enter image description here I have a DNS server connected to Router2 with an IP address let's say 192.168.1.12. I want to create a static route such that Router1(and its connected devices) can access the DNS server connected to Router2. And my configuration looks like the below image but I cannot get it to work(ping from Router1 connected device fails with Request timeout for icmp_seq). enter image description here

PS:

  • Due to few other things running along with the DNS server I cannot move that device to Router1.
  • All devices listed here are set to static IP addresses

Router2 must allow the inbound packets in the firewall settings. Most likely Router2 is in the typical configuration where it thinks that it's directly connected to the Internet, and uses a "safe" firewall configuration which blocks all new inbound connections from the "WAN" side.

(If Router2 has the NAT feature enabled, it might interfere with inbound connections, although it shouldn't. Still, with the static route in place, Router2 has no need to perform NAT and ideally should have it disabled.)

Also, your route destination doesn't quite match the specified netmask, as the netmask indicates that the entire 4th byte of the address is irrelevant, yet the destination has it specified. It might work anyway (the netmask will cause those bits to be ignored), but it also might be internally rejected by the router, depending on how picky the firmware is. (Some enforce 'canonical' notation, some don't.)

It should instead be either:

  • destination 192.168.1.12 with netmask 255.255.255.255 (a single host), or
  • destination 192.168.1.0 with netmask 255.255.255.0 (a /24 network).