core-agent-linux/network/iptables-yum-proxy
Marek Marczykowski 8c9433fc00 yum-proxy: use iptables-restore to set firewall rules
Simple iptables sometimes returns EBUSY.
2013-08-05 02:08:52 +02:00

18 lines
293 B
Bash
Executable File

#!/bin/sh
if [ "$1" == "start" ]; then
CMD="-I"
else
# Remove rules
CMD="-D"
fi
cat <<__EOF__ | iptables-restore -n
*filter
$CMD INPUT -i vif+ -p tcp --dport 8082 -j ACCEPT
COMMIT
*nat
$CMD PR-QBS-SERVICES -i vif+ -d 10.137.255.254 -p tcp --dport 8082 -j REDIRECT
COMMIT
__EOF__