The reason the direct IP hosts work w/o needing you to add secondary IPs to the WAN interface is that when you create the /32 address facing the direct-IP host, this creates a static /32 route in your IP routing table. Since this route leads to an interface OTHER than the WAN interface, the router will now respond to ARP requests on the WAN interface which are looking for the /32 in question.
When you specify a NAT rule, however, this is not the same thing. All a NAT rule does is instruct the router to modify the contents of the IP header of matching packets.
Imagine a postal worker whose job it was to place a sticker over the return addresses on envelopes. This worker could only cover the addresses on envelopes which reach her desk. Adding a NAT rule does nothing to modify the system’s routing table. Therefore, if the router considers x.x.x.32/29 as existing on the WAN interface, then adding a NAT rule for x.x.x.37 will not change this fact. Without also changing the routing table, the router will not respond to ARPs for x.x.x.37 received on the WAN interface - because the intended recipient is “outside” the router, and must obviously answer the ARP on its own behalf. Since in the case of dstnat, the x.x.x.37 address is NOT attached to the WAN network, the router must respond to these ARP requests on behalf of the intended destination host.
Again - The DSTNAT rule only instructs the router to change the contents of the IP headers. In the example, it will change the destination address of x.x.x.37 into (e.g.) 192.168.100.37 on any packet it sees. It will also remember this translation so that whenever it sees a reply from 192.168.100.37, the router will replace the 192.168.100.37 source address with x.x.x.37 on the packet’s “from” field. The remote host will be none the wiser that anything unusual has taken place. Since the NAT rule doesn’t affect any other IP behavior, we must take another action to cause these packets destined for x.x.x.37 to end up in the router’s hands so that it can work its magic.
How do we do that?
One way is to have the upstream network explicitly route this IP to your router. Your connection is not configured this way, so it’s not an option for you. Instead, your router must respond to any ARP requests for x.x.x.37 so that the packet will be delivered to the router for processing.
There are two ways of doing this:
- apply the address directly to the WAN interface. (“actual” arp)
- proxy arp - which works when the router knows that the IP destination of x.x.x.37/32 lives somewhere other than on the WAN interface.
Method 1 is obvious - tell the router that it’s actually responsible for this IP address directly, and it will naturally reply to ARP requests for x.x.x.37 - it really IS the router’s IP address.
Method 2 is how your direct-IP hosts are being serviced as I stated above - the router knows that x.x.x.36/32 lives on some other interface. In the case of direct-IP hosts, the router doesn’t have any instructions to mess with the IP headers, so it just forwards the packets intact, and forwards the replies intact.
In order to get the proxy-arp behavior for a dstnat IP, you must also tell the router that x.x.x.37/32 lives somewhere other than on the WAN interface. One simple choice is a black hole - because the dstnat IP doesn’t really live anywhere, right?
/ip route add dst=x.x.x.37/32 type=blackhole
Adding this route will tell your router that .37 lives somewhere other than the WAN interface, so the WAN interface will begin responding to ARP requests for .37 in proxy for the blackhole…
But before the black hole gets to gobble up the packets, the DSTNAT rule will modify x.x.x.37 to be the true internal IP of the host. After making this change, the router will then see that the packet’s new destination IP is not the black hole (or the router itself if using method 1), but some other host. Thus the IP forwarding engine in the router will now process the packet with its new destination address, and will forward the packet wherever is most appropriate.