首页 > 其他 > 详细

nftables 相关知识

时间:2020-02-20 01:05:12      阅读:118      评论:0      收藏:0      [点我收藏+]

Wiki地址:https://wiki.nftables.org/wiki-nftables/index.php/Main_Page

 

Centos 8已将iptables替换为nftables,因此是时候学习nftables与iptables之间的差异。

Centos 8中Firewalld守护进程使用nftables作为默认后端,在Centos 7中使用的是iptables作为后端。

 

nftables主要有三个概念:

  table - 指包含chain的一个容器

  chain - 指包含在一个table里的rule容器

  rule - 指包含在chain里的action

 

Table

  table语法

    - 待更新

  table语法示例

    - 待更新

Chain

  chain语法

    - 待更新

  chain语法示例

    - 待更新

Rules

  handle is an internal number that identifies a certain rule.

  position is an internal number that is used to insert a rule before a certain handle.

  rule语法

# nft add rule [<family>] <table> <chain> <matches> <statements>
# nft insert rule [<family>] <table> <chain> [position <position>] <matches> <statements>
# nft replace rule [<family>] <table> <chain> [handle <handle>] <matches> <statements>
# nft delete rule [<family>] <table> <chain> [handle <handle>]

 

  rule语法规则中包含 Matches 和 Statements,因为内容太多,请参考文档 https://wiki.nftables.org/wiki-nftables/index.php/Quick_reference-nftables_in_10_minutes#Rules

  

  rule示例

    - 待更新

nftables 相关知识

原文:https://www.cnblogs.com/vincenshen/p/12333904.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!