-   Linux - Newbie (
-   -   Can someone help me to creat a IPTables rule (

danykallery 02-08-2012 12:46 AM

Can someone help me to creat a IPTables rule
i need all http traffic comes to redirect to port.

can some one help me to sort this issue. i am not goot in NAT configuration. (Local Server) Connected with VPN username password - Remote server (Client http request)******-*******

Whenever (10.100.109/110.0 / 32 network trying to connect to get responds from

War3zWad|0 02-08-2012 05:56 AM

Well had you done any Google searches you would have come up with many different examples, but hey you go:


iptables -A PREROUTING -t nat -i ethX -p tcp --dport 80 -j DNAT --to
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth1 -j ACCEPT

of course change ethX to the NIC that is going to be accepting and forwarding

Then to make it a little more secure you could specify the source network so the only go to the forwarded port:

iptables -A PREROUTING -t nat -i eth1 -p tcp --source --dport 80 -j DNAT --to
some sites with some good examples:

Google can be your friend as there have been many before you that have wanted to do exactly what you are trying to do.

frankbell 02-08-2012 09:45 PM

Here's a link to the firewall script that one of the members of my LUG posted. Perhaps it will help.

All times are GMT -5. The time now is 01:04 PM.