iptables的数据包的流程介绍(转)

l转自:http://www.opsers.org/linux-home/security/iptables-related-concepts-and-processes-the-packet-figure.html iptables 相关概念 匹配(match):符合指定的条件,比如指定的 IP 地址和端口。 fjallraven kanken pas cher 丢弃(drop):当一个包到达时,简单地丢弃,不做其它任何处理。接受(accept):和丢弃相反,接受这个包,让这个包通过。拒绝(reject):和丢弃相似,但它还会向发送这个包的源主机发送错误消息。这个错误消息可以指定,也可以自动产生。目标(target):指定的动作,说明如何处理一个包,比如:丢弃,接受,或拒绝。跳转(jump):和目标类似,不过它指定的不是一个具体的动作,而是另一个链,表示要跳转到那个链上。规则(rule):一个或多个匹配及其对应的目标。链(chain):每条链都包含有一系列的规则,这些规则会被依次应用到每个遍历该链的数据包上。 Asics Mexico damskie 每个链都有各自专门的用途, 这一点我们下面会详细讨论。表(table):每个表包含有若干个不同的链,比如 filter 表默认包含有 INPUT,FORWARD,OUTPUT 三个链。iptables 有四个表,分别是:raw,nat,mangle和filter,每个表都有自己专门的用处,比如最常用filter表就是专门用来做包过滤的,而 nat 表是专门用来做NAT的。策略(police):我们在这里提到的策略是指,对于 iptables 中某条链,当所有规则都匹配不成功时其默认的处理动作。连接跟踪(connection track):又称为动态过滤,可以根据指定连接的状态进行一些适当的过滤,是一个很强大的功能,但同时也比较消耗内存资源。 Cheap Nike Shoes Outlet UK 经过iptables的数据包的流程介绍 一个数据包到达时,是怎么依次穿过各个链和表的 123 基本步骤如下: 1. Air Jordan 6 bambini 数据包到达网络接口,比如 eth0。 Nike Air Max 97 Femme 2. Adidas Zx Flux Homme Bleu 进入 raw 表的 PREROUTING 链,这个链的作用是赶在连接跟踪之前处理数据包。 3. 如果进行了连接跟踪,在此处理。 4. 进入 mangle 表的 PREROUTING 链,在此可以修改数据包,比如 TOS 等。 5.

  • Air Jordan 6 Uomo
  • 进入 nat 表的 PREROUTING 链,可以在此做DNAT,但不要做过滤。 Soldes Asics 2017 6. 决定路由,看是交给本地主机还是转发给其它主机。 到了这里我们就得分两种不同的情况进行讨论了,一种情况就是数据包要转发给其它主机,这时候它会依次经过: 7. 进入 mangle 表的 FORWARD 链,这里也比较特殊,这是在第一次路由决定之后,在进行最后的路由决定之前,我们仍然可以对数据包进行某些修改。 8. 进入 filter 表的 FORWARD 链,在这里我们可以对所有转发的数据包进行过滤。需要注意的是:经过这里的数据包是转发的,方向是双向的。 9. Adidas Zx Flux Homme Grise 进入 mangle 表的 POSTROUTING 链,到这里已经做完了所有的路由决定,但数据包仍然在本地主机,我们还可以进行某些修改。 10. 进入 nat 表的 POSTROUTING 链,在这里一般都是用来做 SNAT ,不要在这里进行过滤。 11. 进入出去的网络接口。 Nike Air Max 1 femme 完毕。 Air Jordan 5 Homme 另一种情况是,数据包就是发给本地主机的,那么它会依次穿过: 7. 进入 mangle 表的 INPUT 链,这里是在路由之后,交由本地主机之前,我们也可以进行一些相应的修改。 8. 进入 filter 表的 INPUT 链,在这里我们可以对流入的所有数据包进行过滤,无论它来自哪个网络接口。 9. 交给本地主机的应用程序进行处理。 10. 处理完毕后进行路由决定,看该往那里发出。 asics gel stratus donna 11.

  • O.J. Howard Alabama Jersey
  • 进入 raw 表的 OUTPUT 链,这里是在连接跟踪处理本地的数据包之前。 nike air huarache bambini 12. 连接跟踪对本地的数据包进行处理。 13. 进入 mangle 表的 OUTPUT 链,在这里我们可以修改数据包,但不要做过滤。 14. 进入 nat 表的 OUTPUT 链,可以对防火墙自己发出的数据做 NAT 。 15. 再次进行路由决定。 16. 进入 filter 表的 OUTPUT 链,可以对本地出去的数据包进行过滤。 17. 进入 mangle 表的 POSTROUTING 链,同上一种情况的第9步。注意,这里不光对经过防火墙的数据包进行处理,还对防火墙自己产生的数据包进行处理。 Mochilas Fjallraven Kanken 18. 进入 nat 表的 POSTROUTING 链,同上一种情况的第10步。 New Balance 1600 homme A.J. McCarron College Jerseys 19. 进入出去的网络接口。 Green Bay Packers Jerseys 完毕。

    Posted in Linux | Leave a comment

    Progression can be slowed down

    but it can be stopped. Nike Air Huarache homme Air Jordan 12 (XII) In 40 years our children will be reading about the plight of LGBT people the way I read about civil rights and the women movement. Shame on you for casting your judgement. Joe Namath Jersey nike air max 2017 dames Rood Amelia Victoria Vega Polanco was crowned Miss Universe in 2003, the first Dominican woman to achieve this feat. Nike Air Max 90 Pas Cher Pour Homme She also won the National Costume competition and is the third among Miss Universe winners to do so. nike air max tn donna Is a television star. adidas zx 850 donna Adidas buty męskie I felt like it portrayed me as dumb instead of as a kid who had never had consistent academic instruction and ended up thriving once he got it. Nike Free Rn Flyknit Homme billig nike air norge Canotte Atlanta Hawks Quinton Aaron did a great job acting the part, but I could not figure out why the director chose to show me as someone who had to be taught the game of football. Air Jordan 11 bambini Moving around ketchup bottles or Leigh Anne explaining to me what blocking is about, I watched those scenes thinking, ‘No, that’s not me at all! I’ve been studying really studying the game since I was a kid!’ That was my main hang up with the film.. And for me, as much as I was blessed to have a great education, Ed,cheap oakleys sunglasses I wanted to be a pro basketball player. Adidas NMD Heren I pursued it aggressively, and when that athletic rug, figuratively and literally, was snatched from up under my feet, let me tell you, it hurt unbelievably. New Balance 373 homme And I even tried the following year with, after being cut by the Atlanta Hawks, Red Auerbach had me come to try out for the Boston Celtics. Adidas Harden Crazylight Cheap Wholesale NFL Jerseys Free Shipping This year, that same 60 seconds costs $10 million. Asics Gel Lyte 5 Donna

    Back in 1967, the number one scripted show on television was The Andy Griffith Show on CBS. Nike Air Max 1 Femme

    And, today, the number one scripted show on television is NCIS, also on CBS. Nike Free Run 5.0 femme In MMA, one thing money can’t buy is experience. It is one thing to be a talented fighter and athlete, but there is a bigger advantage still in having spent time in that cage, in knowing how to deal with external Wholesale Discount NFL Jerseys pressures, in knowing how to train and cut weight. Experience can not be substituted by way of a drug. nike roshe flyknit uomo Adidas Superstar Donna

    Maglia Scottie Pippen Nope: The defense is depleted at cornerback. new balance 574 damskie kolorowe

  • Air Foamposite One
  • The offense has been on a remarkable run of mistake free football during its winning streak, but doesn’t have a real running threat. Canotte Philadelphia 76ers The Packers could be hard pressed to keep up in high scoring Wholesale Cheap Authentic Jerseys games like they were during a midseason four game skid.. adidas yeezy boost 350 v2 homme Soccer is truly an international sport and Wholesale Discount Jerseys has a rotating World Cup schedule. Air Jordan 14 (XIV) American sports fans used to have a hard time watching their favorite team when Discount Authentic Jerseys competitions were held outside the United States. Now, through the Internet, watching soccer online is easy but not always free.

    Posted in Linux | Leave a comment

    编译安装LAMP之httpd

    1、卸载rpm安装的httpd版本 准备编译安装LAMP环境,操作系统RedHat 5.8 2.6.18-8.el5 kernel 事先已经安装好了rpm格式的httpd,所以首先要卸载 #rpm -e httpd httpd-manual 但是发现有软件依赖性,这样还是卸不掉的, nike internationalist homme 所以加选项强制卸载如下 #rpm -e httpd –nodeps #rpm -e httpd-manual 然后检查有没有卸载掉 #rpm -qa| grep http 2、下载最新软件因httpd运行需要apr, nike air force 1 enfants 所以到官网下载最新的版本http://apr.apache.org/ 接着下载最新的 apr-1.5.2.tar.bz2 apr-util-1.5.4.tar.bz2 httpd-2.4.17.tar.bz2 直接放在/tmp下 3、这几个软件有安装先后顺序的 apr —->apr-util —–>httpd A、安装apr #cd /tmp # tar xf apr-1.5.2.tar.bz2 # cd apr-1.5.2 # ./configure –prefix=/usr/local/apr # make # make install B、安装apr-util # tar xf apr-util-1.5.4.tar.bz2 # cd apr-util-1.5.4 # ./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr # make # make install 以上两步很顺利,一般没什么问题 C、接着安装httpd # tar xf httpd-2.4.17.tar.bz2 # cd httpd-2.4.17 # ./configure –prefix=/usr/local/apache –sysconfdir=/etc/httpd–enable-so –enable-rewirte –enable-ssl –enable-cgi –enable-cgid –enable-modules=most –enable-mods-shared=most –enable-mpms-shared=all –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util 一开始没加–with-pcre=/usr/local/pcre, asics onitsuka tiger homme 想着使用系统里面已经有的pcre 结果总不成功 ,后面的make && make install一直出错,提示如下 util_pcre.c: In function ‘ap_regcomp’: util_pcre.c:128: error: ‘PCRE_DUPNAMES’ undeclared (first use in this function) util_pcre.c:128: error: (Each undeclared identifier is reported only once util_pcre.c:128: error: for each function it appears in.) make[2]: *** [util_pcre.lo] 错误 1 make[2]: Leaving directory `/tmp/httpd-2.4.17/server’ make[1]: *** [all-recursive] 错误 1 make[1]: Leaving directory `/tmp/httpd-2.4.17/server’ make: *** [all-recursive] 错误 1 网上查了一下,说是原来的pcre版本太低, Nike Air Max 2016 Homme 看看自己的版本 [root@localhost tmp]# rpm -qa | grep pcre pcre-6.6-1.1 pcre-devel-6.6-1.1 于是到官网下了个最新的pcre版本 pcre2-10.20.tar.bz2 接着源码安装 # tar xf pcre2-10.20.tar.bz2 # cd pcre2-10.20 # ./configure –prefix=/usr/local/pcre # make # make install 安装好后继续编译安装httpd,发现还是出错,提示信息变成在目录/usr/local/pcre下找不到文件pcre-config, adidas stan smith homme rouge 怎么回事?去目录里面果然没有pcre-config, Adidas Superstar Femme Fleur 但有个pcre2-config,于是在/usr/local/pcre下创建了个符号连接文件, Adidas Yeezy 550 Homme 指向/usr/local/pcre/pcre2-config 接着安装httpd,发现还是有问题,提示还是找不到莫名其妙,莫非版本太高了?打开文件/usr/local/pcre/pcre2-config,看脚本内容,原来命令已经变成pcre2,没有pcre了。估计是版本太高了 于是重回pcre官网, New Balance 1600 homme 下载了个另外维护的版本较低的 pcre-8.36.tar.bz2 把原先已经源码安装的目录删除 #rm -rf /usr/local/pcre 然后重新安装 # tar xf pcre-8.36.tar.bz2 # cd pcre-8.36 # ./configure –prefix=/usr/local/pcre # make # make install 接着安装httpd # ./configure –prefix=/usr/local/apache –sysconfdir=/etc/httpd –enable-so –enable-rewrite –enable-ssl –enable-cgi –enable-cgid –enable-modules=most –enable-mods-shared=most –enable-mpms-shared=all –with-apr=/usr/local/apr –with-apr-util=/usr/local/apr-util –with-pcre=/usr/local/pcre #make && make install 终于不报错了 虽如此,有没有编译成功还是有点不确定,开启服务看看就知道了 D、安装验证 [root@localhost httpd-2.4.17]# cd /usr/local/apache/ [root@localhost apache]# ls bin build cgi-bin error htdocs icons include logs man manual modules [root@localhost apache]# bin/ap apachectl apxs [root@localhost apache]# bin/apachectl start [root@localhost apache]# netstat -tlnp | grep 80 tcp 0 0 :::80 :::* LISTEN 9484/httpd 总算装好了, new balance homme 接着访问一下看看吧 E、 http://192.168.0.1/ 显示 It works! 主页文件默认在# cat htdocs/index.html, Adidas Zx 700 Femme Leopard 可以根据自己的需求更改。

    Posted in Linux | Leave a comment