firewall/firewall.ml
2022-08-29 07:35:35 +02:00

25 lines
499 B
OCaml

open Nftables
let nftables = [
Flush FlushRuleset;
Add (AddRule {
family = Inet;
table = "filter";
chain = "forward";
expr =
[
Log { prefix = Some "test"; group = None };
Match {
left = Payload (Udp UdpSport);
right = Set [Number 53];
op = NotEq };
Verdict Accept
]
})
]
let json = json_of_nftables nftables
let () =
print_string (Yojson.Basic.to_string json);
print_newline ()