blob: 27242b36c3c510a814bf6d86f610afcb7917ed0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/bash
tmpfile=$(mktemp)
if [ ! -w $tmpfile ] ; then
echo "Failed to create tmp file" >&2
exit 0
fi
trap "rm -rf $tmpfile" EXIT # cleanup if aborted
echo "flush ruleset
add table t
add chain t c
table inet filter {
set blacklist_v4 { type ipv4_addr; flags interval; }
}
add element inet filter blacklist_v4 {
192.168.0.1/24,
}" >$tmpfile
$NFT -f $tmpfile
# make sure flush ruleset works right
$NFT -f $tmpfile
|