Linux Port Forward

Proxy server: CentOS 6.6 --> IP_a
Backend server: windows server 2003 --> IP_b

Steps:
1. Enable ip_forward
vim /etc/sysctl.conf
net.ipv4.ip_forward=1
sysctl -p

2. Add firewall rules:
iptables -t nat -A PREROUTING -p tcp --dport 21 -j DNAT --to-destination IP_b:21
iptables -t nat -A POSTROUTING -p tcp -d IP_b --dport 21 -j SNAT --to-source IP_a
iptables -t nat -A PREROUTING  -p tcp  --dport 61000:61100 -j DNAT --to IP_b:61000-61100
service iptables save

3. Comment firewall rules:
vim /etc/sysconfig/iptables
#-A FORWARD -j REJECT --reject-with icmp-host-prohibited

4. Restart firewall:
service iptables restart

Comments

Popular posts from this blog

Nginx Proxy & Load Balance & LNMP

Snort+barnyard2+Snorby CentOS 6.5_64 Installation

ORACLE Error