3 ms·
-- > Finally you can apply the rule like so: iptables -A INPUT \ -p udp --dport 53 \ -m bpf --bytecode "14,0 0 0 20,177 0 0 0,12 0 0 0,7 0
by nine_k 13y ago
--
> Finally you can apply the rule like so:
iptables -A INPUT \
-p udp --dport 53 \
-m bpf --bytecode "14,0 0 0 20,177 0 0 0,12 0 0 0,7 0 0 0,64 0 0 0,21 0 7 124090465,64 0 0 4,21 0 5 1836084325,64 0 0 8,21 0 3 56848237,80 0 0 12,21 0 1 0,6 0 0 1,6 0 0 0," \
-j DROP
--
Writing raw opcodes to execute in the kernel context on each packet received? Yes, please! :)
- cnvogel 13y agoWell... using the new “nftables” packet filter, this will be the "normal" way of packet filtering. So, yes, please! ☺ http://netfilter.org/projects/nftables/ http://netfilter.org/projects/nftables/ ❝Pseudo-state machine in kernel-space: the userspace utility nftables interprets the rule-set provided by the user (using a new syntax), it compiles it into the pseudo-state machine bytecode and then it transfers it to the kernel via the nftables Netlink's API. Roughly, the idea behind nftables is similar to the Berkeley Packet Filters (BPF).❞
- nine_k 13y agoWell, I like bytecode machines. But I'd expect a compiler or and assembler of some sort that allows to write human-readable code.