2013-08-05 02:08:52 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-02-21 13:28:49 +01:00
|
|
|
RULE_FILTER="INPUT -i vif+ -p tcp --dport 8082 -j ACCEPT"
|
|
|
|
RULE_NAT="PR-QBS-SERVICES -i vif+ -d 10.137.255.254 -p tcp --dport 8082 -j REDIRECT"
|
2013-08-05 02:08:52 +02:00
|
|
|
|
2014-02-21 13:28:49 +01:00
|
|
|
if [ "$1" == "start" ]; then
|
2013-08-05 02:08:52 +02:00
|
|
|
cat <<__EOF__ | iptables-restore -n
|
|
|
|
*filter
|
2014-03-26 00:02:10 +01:00
|
|
|
-I $RULE_FILTER
|
2013-08-05 02:08:52 +02:00
|
|
|
COMMIT
|
|
|
|
*nat
|
2014-03-26 00:02:10 +01:00
|
|
|
-I $RULE_NAT
|
2013-08-05 02:08:52 +02:00
|
|
|
COMMIT
|
|
|
|
__EOF__
|
2014-02-21 13:28:49 +01:00
|
|
|
else
|
|
|
|
# Remove rules
|
|
|
|
iptables -D $RULE_FILTER
|
|
|
|
iptables -t nat -D $RULE_NAT
|
|
|
|
exit 0
|
|
|
|
fi
|