iptables -A PREROUTING -t nat -i eth1 -p tcp --dport 80 -j DNAT --to 192.168.1.50:80
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth1 -j ACCEPT
then to save the rules:
service iptables save
- eth1 is the external interface that accepts packets
- 192.168.1.50 is the IP address where packets are forwarded
- Port 80 is the port that is being forwarded
No comments:
Post a Comment