×

Welcome to TagMyCode

Please login or create account to add a snippet.
1
0
 
1
Language: Bash
Posted by: Mattia Lucariello
Added: Sep 19, 2014 12:58 PM
Modified: Sep 19, 2014 1:03 PM
Views: 17
Tags: bash iptables
  1. iptables -A INPUT -p tcp \
  2. -s ${CLIENT_SERVER_IP} --sport 1024:65535 \
  3. -d ${SERVICE_SERVER_IP} --dport ${YOUR_SERVICE_PORT} \
  4. -m state --state NEW,ESTABLISHED -j ACCEPT
  5.  
  6. iptables -A OUTPUT -p tcp \
  7. -s ${SERVICE_SERVER_IP} --sport ${YOUR_SERVICE_PORT} \
  8. -d ${CLIENT_SERVER_IP} --dport 1024:65535 \
  9. -m state --state ESTABLISHED -j ACCEPT