mirror of
https://github.com/GrapheneOS/infrastructure.git
synced 2025-11-25 01:03:06 -05:00
add nftables deployment script
This commit is contained in:
parent
11c9421c63
commit
e626d67dc1
1 changed files with 21 additions and 0 deletions
21
deploy-nftables
Executable file
21
deploy-nftables
Executable file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. shared.sh
|
||||||
|
. hosts.sh
|
||||||
|
. ssh.sh
|
||||||
|
|
||||||
|
for host in ${hosts_all[@]}; do
|
||||||
|
remote=root@$host
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo $host
|
||||||
|
echo
|
||||||
|
|
||||||
|
cp etc/nftables/nftables-${hosts_firewall[$host]:-web}.conf tmp
|
||||||
|
sed -i "s/{{synproxy_threshold}}/$(( ${hosts_conntrack_size[$host]} / 64 ))/g" tmp
|
||||||
|
sed -i "s/{{ssh_ipv4}}/$ssh_ipv4/g" tmp
|
||||||
|
sed -i "s/{{ssh_ipv6}}/$ssh_ipv6/g" tmp
|
||||||
|
rsync tmp $remote:/etc/nftables.conf
|
||||||
|
rm tmp
|
||||||
|
ssh $remote systemctl enable --now nftables.service
|
||||||
|
done
|
||||||
Loading…
Add table
Add a link
Reference in a new issue