File: recursive_merge

package info (click to toggle)
nftables 1.1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,384 kB
  • sloc: ansic: 50,901; sh: 20,277; yacc: 5,861; python: 1,746; lex: 1,367; makefile: 392
file content (22 lines) | stat: -rwxr-xr-x 467 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
set -e

RULESET="define myset2 = {
      2.2.3.0,
}
define myset = {
      1.1.1.0,
      2.2.2.0,
      $myset2,
}
define myset3 = {
      { 1.1.1.0, 2.2.2.0 }
}
add table ip x
add chain ip x y
add rule ip x y ip saddr { \$myset, 3.3.3.0 }
add rule ip x y ip saddr { { 4.4.4.0, 5.5.5.0 }, 6.6.6.0 }
add rule ip x y ip saddr { { 8.8.8.0, { 4.4.4.0, 5.5.5.0 } }, 6.6.6.0 }
add rule ip x y ip saddr { 9.9.9.0, \$myset3, 7.7.7.0 }"

$NFT -f - <<< "$RULESET"