iptables-updates-proxy 383 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. RULE_FILTER="INPUT -i vif+ -p tcp --dport 8082 -j ACCEPT"
  3. RULE_NAT="PR-QBS-SERVICES -i vif+ -d 10.137.255.254 -p tcp --dport 8082 -j REDIRECT"
  4. if [ "$1" = "start" ]; then
  5. cat <<__EOF__ | iptables-restore -n
  6. *filter
  7. -I $RULE_FILTER
  8. COMMIT
  9. *nat
  10. -I $RULE_NAT
  11. COMMIT
  12. __EOF__
  13. else
  14. # Remove rules
  15. iptables -D $RULE_FILTER
  16. iptables -t nat -D $RULE_NAT
  17. exit 0
  18. fi