iptables-updates-proxy 447 B

12345678910111213141516171819202122
  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. # shellcheck disable=SC2086
  16. iptables -D $RULE_FILTER
  17. # shellcheck disable=SC2086
  18. iptables -t nat -D $RULE_NAT
  19. exit 0
  20. fi