The default behavior of Linksys firmware is that if the router receives a request destined for the WAN IP, but from within the LAN, then it gets forwarded to the DMZ host. nfortunately OpenWRT doesn't do this out of the box, and I'd like to set it up so that it does. Let me give you a practical example.
I have a static IP provided to me by my DSL provider, let's call it "EXTIP" for short. I run various servers (web, mail, chat, etc.) on one of my Linux machines *inside* the LAN -- let's say its IP address is "DMZHOST" for short. And, as the above name implies, I had that box's IP address entered into the "DMZ Host" part of the Linksys firmware.
So, let's say J. Random Hacker, somewhere out there on the Internet, wants to view a web page on my server. He browses to http://www.mydomain.com/, which resolves to EXTIP. His machine then tries contacting EXTIP and the WRT54GS "answers." It immediately discerns that this request should get forwarded to DMZHOST, and so it does. Hacker gets his web page, and the world is happy.
Now, let's say someone who's on a laptop on my *internal* LAN goes to browse one of my web pages. He can browse directly to its IP address (e.g. "http://DMZHOST/") and it works fine. But what if he tries to use the "real" domain name, www.mydomain.com? Well, he types that into his browser, and DNS resolves it to EXTIP. So his laptop tries contacting EXTIP. The LInksys box picks this up and says "Hey wait a minute, *I'm* EXTIP." The way each firmware handles this special case is where I am having the problem.
In the case of the Linksys firmware, the router says "Ah, I have a DMZ host, might as well pass that request along" and hands it over to DMZHOST, which responds and fulfills the request. But with OpenWRT, the WRT54GS *itself* tries to handle this request.
The practical upshot of all this is that, when I was running the old Linksys firmware, anyone, whether they be on or off my internal LAN, can browse to http://www.mydomain.com/ and get my not-really-that-lovely web page. Now, with OpenWRT, people on the *outside* can see it just fine, but people *inside* the LAN get the weird small thttpd server that runs on the WRT itself.
I'm sorry if this sounds long-winded, but this is the only way I know of describing this problem. I'm not too familiar with the whole concept of iptables, firewalls, port forwarding, etc. and I don't know all the "lingo."
I am using the default OpenWRT configuration, with the only change being that I enabled the following lines in /etc/firewall.user to set up the DMZ:
### DMZ (should be placed after port forwarding / accept rules)
iptables -t nat -A prerouting_rule -i $WAN -j DNAT --to DMZHOST
iptables -A forwarding_rule -i $WAN -d DMZHOST -j ACCEPT
I did not see this question in the FAQ or documentation, nor did I find anything when searching the forum archives. (although the fact that I am not too familiar with the lingo and how to describe my problem propbably hampered my search keyword effectiveness.)
Any and all help greatly appreciated. Thanks!
Donald
