Diewuxi

Belive tomorrow will be better, love science and technology, support communication and understanding, always ready for thought turn.

Blog / engineering_technology / computer / software / network / iptables 笔记

Blog


Article^ Parent

iptables 笔记


Date: 2016-03-26 00:00:00
Description: iptables 使用笔记。
Keywords: iptables, Linux, 转发
Category: engineering_technology/computer/software/network
Tag: iptables, network, linux
Link: https://www.diewuxi.com/blog/article/91.html

Changelog

* 2016-03-26
    * Done
                        

五个hook function(CHAIN)

  1. INPUT

主要与想要进入我们 Linux 本机的数据包有关;

  1. OUTPUT

主要与我们 Linux 本机所要送出的数据包有关;

  1. FORWARD

与 Linux 本机比较没有关系, 他可以传递数据包到后台的计算机中,与下列 nat table 相关性较高。

  1. PREROUTING

在进行路由判断之前所要进行的规则(DNAT/REDIRECT)

  1. POSTROUTING

在进行路由判断之后所要进行的规则(SNAT/MASQUERADE)

四种处理机制(table):

  1. filter:Input,Output,Forward

过滤数据包,该表根据管理员预定义的一组规则过滤符合条件的数据包。filter表是iptables默认的表

  1. nat:prerouting,postrouting,output

地址转换(NAT) 主要用于网络地址转换,该表可实现一对一。一对多,多对多等工作,iptables就是使用该表实现共享上网功能。

  1. mangle:Input ,Output,Forward,prerouting,postrouting

包重构(mangle)对指定的数据包进行修改,例如更改TTL和TOS等,实际中很少使用。

  1. RAW:prerouting,output

RAW 很少使用

Last modified: 2016-03-26

Comments [0]

There is no comments now.

Write comment(* is necessary, and email is not shown to public)


Diewuxi 2017--2024