Files
alpine-server-setup/services/firewall/install.sh
2025-09-30 13:04:56 +02:00

17 lines
311 B
Bash

#!/bin/sh
echo "Setting up firewall..."
apk add nftables
rc-update add nftables boot
cat << EOF > /etc/nftables.nft
#!/usr/sbin/nft -f
# The state of stateful objects saved on the nftables service stop.
include "/var/lib/nftables/*.nft"
# Rules
include "/etc/nftables.d/*.nft"
EOF
rc-service nftables start