reload firewall rules on start

seems to be some race condition or weird interaction between docker and uci firewall scripts preventing firewall rules from loading properly. so flush all tables and reload the firewall
pull/1/head
Jordan Sokolic 2020-04-17 13:46:44 +03:00
parent 7ca44ef182
commit a4f19bbbe1
1 changed files with 12 additions and 0 deletions

12
run.sh
View File

@ -103,6 +103,17 @@ function _create_or_start_container() {
fi
}
function _reload_fw() {
echo "* reloading firewall rules"
docker exec -it $CONTAINER sh -c '
for iptables in iptables ip6tables; do
for table in filter nat mangle; do
$iptables -t $table -F
done
done
/sbin/fw3 -q restart'
}
function main() {
test -z $WIFI_IFACE && _usage
cd $SCRIPT_DIR
@ -124,6 +135,7 @@ function main() {
echo "* getting address via DHCP"
sudo dhcpcd -q "br-${LAN_ID:0:12}"
_reload_fw
echo "* ready"
}