About Cacher
Web App
Download
Sign In
Sign Up
menu
Cacher is the code snippet organizer for pro developers
We empower you and your team to get more done, faster
Learn More
Akagi201
9/7/2014 - 1:32 PM
share
Share
add_circle_outline
Save
nftables.md
nftables.md
content_copy
file_download
Rendered
Source
Specs
nftables是一个工程提供在linux上进行包过滤(packet filtering)和包分类(packet classification).
nftables用来替换现有的iptables, ip6tables, arptables和ebtables framework.
nftables包括一个内核引擎(Linux kernel engine)和用户空间程序(userspace utility).
nftables利用了NetFilter infrastructure的building blocks -- 如现有的hooks, 连接跟踪系统(connection tracking system), 用户空间排队组件(userspace queueing component), 和日志子系统.
计划有个兼容层来转换现有的iptables防火墙规则到nftables等式(nftables equivalents).
nftables的作者是Patrick McHardy, 它也是NetFilter的维护者.
Details
nftables kernel engine添加了一个简单的虚拟机到linux内核里. 虚拟机里会执行字节码来检查一个网络包和决定包被如何处理.
这个虚拟机实现的操作被有意设计为基础的. 他可以从自己的包中获取数据, 查看相关的元数据(metadata)如内网接口(inbound interface), 管理连接跟踪数据(connection tracking data). 算术运算, 位运算, 比较运算可以被用来基于这些数据来做决定. 虚拟机也能够操作数据集(典型地, IP地址), 允许多路比较操作被替换为一个简单的集合查找(set lookup).
nftables与iptables firewalling code相反, iptables内部知道协议, 深入到逻辑中. 代码必须被复制4次 -- IPv4, IPv6, ARP和Ethernet bridging -- 因为防火墙引擎(firewall engine)在日常使用中太与协议相关了.
nftables vs iptables
简化Linux kernel ABI.
减少代码复制.
提高错误报告(error reporting).
更高效地执行, 存储 和 增量地改变过滤规则.
接口区别
当前使用的iptables, ip6tables, arptables 和 ebtables(IPv4, IPv6, ARP和Ethernet bridging)计划被nft取代, 作为一个简单的统一实现, 提供在核内虚拟机(in-kernel virtual machine)之上的防火墙配置.
nftables也提供了一个改进的用户层API, 允许在一个Netlink转换内原子替换一个或者多个防火墙规则.
References
http://en.wikipedia.org/wiki/Nftables
clear