nftables will replace {ip|ip6|eb|arp}tables in kernel >= 3.13

简介:
nftables未来要替换iptables, 目前还处于开发状态.

nftables is the new packet classification framework that intends to replace the existing {ip,ip6,arp,eb}_tables infrastructure. In a nutshell:

  • It is available in Linux kernels >= 3.13.
  • It comes with a new command line utility nft whose syntax is different to iptables.
  • It also comes with a compatibility layer that allows you to run iptables commands over the new nftables kernel framework.
  • It also comes with the generic set infrastructure that allows you to construct mappings between matchings and actions for performance lookups.
  • This software is under development, so get ready to report bugs in case you experience problems. Netfilter's bugzilla is your friend.
CentOS 7.0 的内核还是3.10的, 所以nftables暂时不会出现在7.0的版本中.
需要试用的话, 可以下载nftables源码, 重新编译内核.
相比iptables的好处

Main Features

  • 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).
  • Fast lookups through performance data structures: The new syntax allows you to arrange you rule-set in a very performance way contrary to purely linear-list based filtering policies. Nftables allows you to use set-based action mappings, ie. for a matching element in the set, issue the action specified by the user.
  • Reduce the amount of code in kernel-space. You can express the packet selectors for all existing protocols using the instruction-set provided by the nftables pseudo-state machine. That means that we do not need a specific extension in kernel-space for each protocol that you want to support. As a side effect, you are likely not need to upgrade your kernel to obtain new features as it has been designed to keep most of the logic in user-space.
  • Unified interface to replace iptables/ip6tables/arptables/ebtables utilities. Thus, we will be able to fully get rid of all the existing code replication in kernel and user-space.

Main differences with iptables

The main differences between nftables and iptables from the user point of view are:

  • The syntax. The iptables command line tool uses a getopt_long()-based parser where keys are always preceded by double minus, eg. --key or one single minus, eg. -p tcp. In that regard, nftables uses cleaner syntax which is inspired by tcpdump.
  • Tables and chains are fully configurable. Contrary to iptables that comes with a set of already defined tables and chains, nftables allows you to create your own tables and chain configurations. We have gotten reports in the past that unused predefined chains were harming performance, even if unused. With this new approach, you can just register the chains that you need depending on your setup.
  • No distinction between matches and targets anymore. In nftables, we have expressions that are basically instructions that can be used to build the rule. This approach is radically different from iptables, that requires specific extensions to match protocol header fields and packet meta information.
  • You can specify several actions in one single rule. In iptables you can only specify one single target. This has been a longstanding limitation that has been resolved by jumping to custom chains at the cost of making the rule-set structure slightly a bit more complex.
  • No built-in counter per chain and rules. In nftables, these are optional so you can enable counters on demand.
  • Generic set infrastructure. This infrastructure integrates tightly into the nftables core and it allows advanced configurations such as dictionariesmaps andintervals to achieve performance-oriented packet classification. The most important thing is that you can use any supported selector to classify traffic.
  • New supported protocols without kernel upgrades. Kernel upgrade is a timeconsuming task, specifically if you have to maintain more than one single firewall in your network. Distributors usually include a bit older Linux kernel versions for stability reasons. With the new pseudo-state machine approach, you will most likely not need such upgrade to support a new protocol, a relatively simple nft userspace utility update should be enough to obtain it.

[参考]
目录
相关文章
|
7月前
|
缓存 网络协议 网络架构
【计算机网络】第三章 数据链路层(MAC地址 IP地址 ARP协议)
【计算机网络】第三章 数据链路层(MAC地址 IP地址 ARP协议)
174 1
|
缓存 网络协议 网络架构
【计算机网络】第三章 数据链路层(MAC地址 IP地址 ARP协议)
【计算机网络】第三章 数据链路层(MAC地址 IP地址 ARP协议)
|
缓存 网络协议 Linux
计算机网络——Wireshark软件使用与协议分析(ARP协议、IP与ICMP分析)
Wireshark软件使用与协议分析 ARP协议分析 使用 Wireshark 抓取局域网的数据包并进行分析: 1. 学习 Wireshark 基本操作:重点掌握捕获过滤器和显示过滤器。 2. 观察 MAC 地址:了解 MAC 地址的组成,辨识 MAC 地址类型。 3. 分析以太网帧结构:观察以太网帧的首部和尾部,了解数据封装成帧的原理。 4. 分析 ARP 协议:抓取 ARP 请求和应答报文,分析其工作过程。 IP与ICMP分析 启动 Wireshark,捕捉网络命令执行过程中本机接受和发送的数据报。
2044 0
计算机网络——Wireshark软件使用与协议分析(ARP协议、IP与ICMP分析)
|
1月前
|
网络协议 网络安全 数据安全/隐私保护
计算机网络概念:网关,DHCP,IP寻址,ARP欺骗,路由,DDOS等
计算机网络概念:网关,DHCP,IP寻址,ARP欺骗,路由,DDOS等
52 4
|
1月前
|
网络协议 网络安全 数据安全/隐私保护
计算机网络概念:网关,DHCP,IP寻址,ARP欺骗,路由,DDOS等
【10月更文挑战第27天】计算机主机网关的作用类似于小区传达室的李大爷,负责将内部网络的请求转发到外部网络。当小区内的小不点想与外面的小明通话时,必须通过李大爷(网关)进行联系。网关不仅帮助内部设备与外部通信,还负责路由选择,确保数据包高效传输。此外,网关还参与路由表的维护和更新,确保网络路径的准确性。
55 2
|
3月前
|
缓存 网络协议 网络架构
网络抓包分析【IP,ICMP,ARP】以及 IP数据报,MAC帧,ICMP报和ARP报的数据报格式
本文详细介绍了如何使用网络抓包工具Wireshark进行网络抓包分析,包括以太网v2 MAC帧、IP数据报、ICMP报文和ARP报文的格式,以及不同网络通信的过程。文章通过抓包分析展示了IP数据报、ICMP数据报和ARP数据报的具体信息,包括MAC地址、IP地址、ICMP类型和代码、以及ARP的硬件类型、协议类型、操作类型等。通过这些分析,可以更好地理解网络协议的工作机制和数据传输过程。
网络抓包分析【IP,ICMP,ARP】以及 IP数据报,MAC帧,ICMP报和ARP报的数据报格式
|
7月前
|
网络协议 Linux Android开发
计算机网络:MAC地址 & IP地址 & ARP协议
计算机网络:MAC地址 & IP地址 & ARP协议
421 7
|
7月前
|
网络协议 数据格式
|
7月前
|
存储 缓存 网络协议
计算机网络:思科实验【2-MAC地址、IP地址、ARP协议及总线型以太网的特性】
计算机网络:思科实验【2-MAC地址、IP地址、ARP协议及总线型以太网的特性】
|
域名解析 缓存 网络协议
计算机网络——网络基础_网络命令的使用(配置主机IP、ipconfig、ping、tracert、arp实战)
任务要求 打开Windows 10的命令(控制台)窗口。 实验步骤 有多种方法打开Windows命令(控制台)窗口。其中一种较为快速的方法是: 在键盘上按下“Win+R"组合键,系统将打开“运行"窗口,如图1-1所示。键入cmd.按回车键或单击“确定”按钮,Windows将打开命令(控制台)窗口,显示俞令提示符,如图1-2所示。
1720 1
计算机网络——网络基础_网络命令的使用(配置主机IP、ipconfig、ping、tracert、arp实战)