I have one webserver inside my LAN but when I try to browse it via the hostname (eg. www.example.com) from a workstation inside my LAN, the browser can't reach the page. Why? From remote (outside), I can browse to the website.
Below is a simple diagram of my network: -
INTERNET <-> ROUTER <-> FIREWALL_IPTABLES <-> SWITCH <-> WEBSERVER + OTHER_WORKSTATIONS
Here is my simple firewall rules: -
$IPTABLES -P INPUT DROP $IPTABLES -P FORWARD DROP $IPTABLES -P OUTPUT DROP
$IPTABLES -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT $IPTABLES -A FORWARD -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT $IPTABLES -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
$IPTABLES -t nat -A PREROUTING -i $fwif -p tcp --dport 80 -j DNAT --to $webserver_ip
$IPTABLES -t nat -A POSTROUTING -o $fwif -j MASQUERADE
Regards, ro0ot