IPTables Port Forwarding


#!/bin/bash

IPtables is empty and ACCEPT all policy is set, thus no packet is blocked. Here are the NAT rules
iptables -A PREROUTING -t nat -p tcp -d 10.100.1.79 –dport 990 -j DNAT –to 192.168.0.21:990
iptables -A POSTROUTING -t nat -d 192.168.0.21 -p tcp -m tcp –dport 990 -j SNAT –to-source 10.100.1.79
iptables -A FORWARD -p tcp -i eth0:3 -d 192.168.0.22 –dport 990 -j ACCEPT

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s