I do not find a way to make the following (I give an example to make it easier):
I have a tool to synchro some files from my laptop to a NAS with SFTP from wherever I am.
My openwrt is doing port forwarding from wan (public.ip.address:66) to NAS.ip:22 for doing so.
It works well.
Yet, when I am at home, so in my lan, it doesn't make sense to go from my computer to internet then back to my NAS, it is rather slow and I would prefer to stay on my lan and go direct to my NAS
So I would like that each request to public.ip.address:66 is routed at the router level into NAS.ip:22 (and not going outside my lan)
I don't see such option in LUCI GUI or I missed it. May-be I have to write down an iptables rules but it is beyond my knowledge
You mean on the machine? I was willing to avoid that because it would mean to do it on each familly member machine...not the solution I would prefer, but interesting solution.
I really thought there was something "easy" to do on the router side
Port forwards configured via UCI/LUCI do NAT reflection automatically. NAT reflection allows you to reach services on your LAN through the external IP WITHOUT the packets actually going through the internet. In other words, if you have the port forwarded there is no step 2. It's already working exactly as you want it to work when connecting to this service while you are connected to the LAN network.