Sun Aug 08, 2004 1:09 pm
Hi jferello,
Well, I could be completely wrong, and I usually am when it comes to RouterOS, but my understanding is that NAT rules act on the source and destination address of a particular packet, rather than by the direction of flow of the packet through the router.
For example, I have two nat rules on my router. To masquerade private IP addresses to the router's public IP, I have a source NAT rule which says to masquerade any packet with a source address of 192.168.0.0/24. Obviously any packet with this source address will be comming from the private LAN. Then, to redirect DNS requests I have a dst-nat rule which says to redirect (which means redirect to the router itself) all packets with a destination address of 0.0.0.0:53, protocol UDP. In other words, any packet heading for any address on port 53, using UDP protocol, gets redirected to the router itself. I guess once the DNS cache is set up on the router, the router listens on port 53.
I've tested the DNS cache by browsing web addresses on a LAN host and checking that they appear in the cache, which they do, so I think it's all working correctly.
As I said, I could be completely wrong, and there is certainly more to NAT than I have described here. Perhaps someone can jump in and confirm what I've said?
Hope this helps,
Guy