Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have router works like this

internet -> eth1 -> Router <- eth0 - LAN

and want to port forward port 80 from to

-A FORWARD -d -p tcp -m tcp --dport 80 -j ACCEPT
-A PREROUTING -d -p tcp -m tcp --dport 80 -j DNAT --to-destination

this works perfectly from interntet, but not from LAN network ex.IP how can i achieve that? (i dont want to use DNS for that)

P.S.: i need to access from both networks

share|improve this question
up vote 2 down vote accepted

You need to make sure all traffic runs back through your router (so it can rewrite it).

A POSTROUTING rule can achieve this. (see:

$ iptables -t nat -A POSTROUTING -d -s \
    -p tcp --dport 80 -j SNAT --to`
share|improve this answer
thx it works perfectly – xinu Jul 11 '12 at 13:14
Heel erg bedankt, je bent de beste! – user127928 Jul 11 '12 at 13:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.