四表五链
四表:filter , nat, manager, raw
五链: 五个HOOK点的链接,pre_rout, foward, post_rout, in ,out

问题:
内核如何匹配,内核使能

iptable 命令转换,和内核交互
libiptc库和内核交互

最终是转换到hook点的处理函数上来.

match模块被添加到系统的链表中
当iptables 调用命令,会把这个过滤规则添加到过滤表中.

在每个HOOK点用操作表组成了操作链,分别调用表中的匹配和过滤函数.

内和match注册:
xt_register_match

filter表分析

match 模块查找
do_command4
command_match
xtables_find_match

表的插入
insert_entry
iptc_insert_entry <libiptc.h>

libiptc和内核交互
http://blog.chinaunix.net/uid-29732842-id-4975834.html
get_socket
set_socket

网络命名空间相关

struct netns_ipv4
#ifdef CONFIG_NETFILTER
struct xt_table *iptable_filter;
struct xt_table *iptable_mangle;
struct xt_table *iptable_raw;
struct xt_table *arptable_filter;
#ifdef CONFIG_SECURITY
struct xt_table *iptable_security;
#endif
struct xt_table *nat_table;
#endif

iptables 深入分析的更多相关文章

  1. 25个iptables常用示例

    本文将给出25个iptables常用规则示例,这些例子为您提供了些基本的模板,您可以根据特定需求对其进行修改调整以达到期望. 格式 iptables [-t 表名] 选项 [链名] [条件] [-j ...

  2. iptables 命令记录

    安装 原理 基本命令 实践 脚本 1.安装 以centos 7为例子安装 yum install -q -y iptables-services配置 iptables [-t table] comma ...

  3. iptables 及容器网络分析

    本文独立博客阅读地址:https://ryan4yin.space/posts/iptables-and-container-networks/ 本文仅针对 ipv4 网络 iptables 提供了包 ...

  4. iptables

    一.在服务器上打开 22.80.9011端口: iptables -A INPUT -p tcp --dport 9011 -j ACCEPT iptables -A OUTPUT -p tcp -- ...

  5. 浅谈iptables 入站 出站以及NAT实例

    --------------本文是自己工作上的笔记总结,适合的可以直接拿去用,不适合的,适当修改即可!--------------- iptbales默认ACCEPT策略,也称通策略,这种情况下可以做 ...

  6. Failed to stop iptables.service: Unit iptables.service not loaded.

    redhat 7 [root@lk0 ~]# service iptables stop Redirecting to /bin/systemctl stop iptables.service Fai ...

  7. 深入分析Spring 与 Spring MVC容器

    1 Spring MVC WEB配置 Spring Framework本身没有Web功能,Spring MVC使用WebApplicationContext类扩展ApplicationContext, ...

  8. CentOS7安装iptables防火墙

    CentOS7默认的防火墙不是iptables,而是firewalle. 安装iptable iptable-service #先检查是否安装了iptables service iptables st ...

  9. linux iptables常用命令之配置生产环境iptables及优化

    在了解iptables的详细原理之前,我们先来看下如何使用iptables,以终为始,有可能会让你对iptables了解更深 所以接下来我们以配置一个生产环境下的iptables为例来讲讲它的常用命令 ...

随机推荐

  1. sam格式详细说明

    原文链接 https://www.jianshu.com/p/386f520e5de1 The SAM Format Specification(sam格式说明) 1 The SAM Format S ...

  2. Bean管理注解的例子

  3. ibatis和hibernate

    ibatis:sql需要自己写hibernate:sql自动生成上面是最大的区别,下面是一些细节.选择Hibernate还是iBATIS都有它的道理:Hibernate的特点:Hibernate功能强 ...

  4. 2.8.3 并发下诡异的HashMap

    package 第二章.并发下诡异的HashMap; import org.junit.Test; import java.util.HashMap;import java.util.Map;impo ...

  5. layer弹出框插件参数及方法介绍

    layerui下载:http://www.layui.com 更多参数请阅读开发文档:http://www.layui.com/doc/modules/layer.html Layui 是一款采用自身 ...

  6. POJ - 3984 迷宫问题 BFS求具体路径坐标

    迷宫问题 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, ...

  7. HTML 5+CSS 3网站布局应用教程 (赵振方) 随书光盘 ​

    <HTML5+CSS3网站布局应用教程>全面介绍HTML 5与CSS 3进行Web设计的知识.全书由16章组成.主要内容包括:主流浏览器对HTML 5的支持情况.HTML 5与HTML4在 ...

  8. CString::MakeLower Crash

    记录一下使用CString::MakeLower可能导致的crash的一个问题: 问题重现: int _tmain(int argc, _TCHAR* argv[]){ std::string  sT ...

  9. Dynamically loading unmanaged OCX in C#

    You'll have to perform a number of steps that are normally taken of automatically when you use the t ...

  10. ios app提交之前需要哪几个证书

    1.遇到的问题 一款App在别人的机器上开发和发布,现在迭代更新和开发需要在一台新mac机上开发和发布. (使用同一个开发者账号)问题: 1.在新mac机器上开发并导入真机测试,是不是需要从别人的机器 ...