WEB开发网      婵犻潧鍊婚弲顐︽偟椤栨稓闄勯柦妯侯槸閻庤霉濠婂骸浜剧紒杈ㄥ笚閹峰懘鎮╅崹顐ゆ殸婵炴垶鎸撮崑鎾趁归悩鐑橆棄闁搞劌瀛╃粋宥夘敃閿濆柊锕傛煙鐎涙ê鐏f繝濠冨灴閹啴宕熼鍡╀紘婵炲濮惧Λ鍕叏閳哄懎绀夋繛鎴濈-楠炪垽鎮归崶褍妲婚柛銊ュ缁傚秹鏁撻敓锟� ---闂佹寧娲╅幏锟�
开发学院网络安全防火墙 详细讲解Linux系统Iptables规则执行顺序 阅读

详细讲解Linux系统Iptables规则执行顺序

 2007-07-26 12:46:17 来源:WEB开发网 闂侀潧妫撮幏锟�闂佸憡鍨电换鎰版儍椤掑倵鍋撳☉娆嶄沪缂傚稄鎷�婵犫拃鍛粶闁靛洤娲ㄩ埀顒佺⊕閵囩偟绱為敓锟�闂侀潧妫撮幏锟�  闂佺ǹ绻楀▍鏇㈠极閻愭娑樷枎閹邦剛娉氶梺鍛婎殔濞层劌鈻撻幋婵愬殫妞ゆ梻鍘х憴锟�
核心提示:预备知识(转): iptable有三种队列(表)规则,mangle queue,详细讲解Linux系统Iptables规则执行顺序, filter queue, nat queue,比如从执行过accept后就中断Filter队列内其它规则,跳到nat队列规则去执行 3, 1,The first is the mang

预备知识(转): iptable有三种队列(表)规则,mangle queue, filter queue, nat queue。

1。The first is the mangle table which is responsible for the alteration of quality of service bits in the TCP header.

2。The second table is the filter queue which is responsible for packet filtering.

* Forward chain: Filters packets to servers protected by the firewall.

* Input chain: Filters packets destined for the firewall.

* Output chain: Filters packets originating from the firewall.

3。The third table is the nat queue which is responsible for network address translation. It has two built-in chains; these are:

* Pre-routing chain: NATs packets when the destination address of the packet needs to be changed.

* Post-routing chain: NATs packets when the source address of the packet needs to be changed

个人总结:

iptables执行规则时,是从从规则表中从上至下顺序执行的,如果没遇到匹配的规则,就一条一条往下执行,如果遇到匹配的规则后,那么就执行本规则,执行后根据本规则的动作(accept, reject, log等),决定下一步执行的情况,后续执行一般有三种情况。

1。一种是继续执行当前规则队列内的下一条规则。比如执行过Filter队列内的LOG后,还会执行Filter队列内的下一条规则。

2。一种是中止当前规则队列的执行,转到下一条规则队列。比如从执行过accept后就中断Filter队列内其它规则,跳到nat队列规则去执行

3。一种是中止所有规则队列的执行。

1 2 3  下一页

Tags:详细 讲解 Linux

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接