From surenkid, 2 Months ago, written in Bash.
Embed
  1. # CentOS 7 disable firewalld, enable iptables
  2. systemctl stop firewalld  
  3. systemctl disable firewalld  
  4. yum install iptables-services -y  
  5. systemctl enable iptables  
  6.  
  7. # Forward redis to public network
  8. iptables -t nat -A PREROUTING -p tcp --dport 36379 -j DNAT --to-destination 10.66.119.86:6379
  9. iptables -t nat -A POSTROUTING -p tcp -d 10.66.119.86 --dport 6379 -j SNAT --to-source 10.104.220.252
  10.  
  11. # Restart iptables service
  12. service iptables save
  13. service iptables restart