日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢(xún)
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
iptablescentos

Linux iptables入門(mén)教程總結(jié)

iptables簡(jiǎn)介

iptables是Linux系統(tǒng)中的一個(gè)防火墻工具,它可以用來(lái)配置網(wǎng)絡(luò)規(guī)則,實(shí)現(xiàn)對(duì)數(shù)據(jù)包的過(guò)濾、轉(zhuǎn)發(fā)等功能,iptables是Linux系統(tǒng)中默認(rèn)的防火墻工具,它的功能非常強(qiáng)大,可以滿(mǎn)足大部分企業(yè)級(jí)防火墻的需求,iptables支持多種操作系統(tǒng),包括Linux、FreeBSD、OpenBSD等。

iptables工作原理

iptables的工作原理是基于Netfilter框架的,Netfilter框架是Linux內(nèi)核中的一個(gè)通用架構(gòu),用于處理各種網(wǎng)絡(luò)協(xié)議的數(shù)據(jù)包,iptables通過(guò)與Netfilter框架進(jìn)行交互,實(shí)現(xiàn)對(duì)數(shù)據(jù)包的過(guò)濾、轉(zhuǎn)發(fā)等功能。

iptables基本語(yǔ)法

1、查看當(dāng)前iptables規(guī)則:

iptables -L -n -v

2、清空當(dāng)前iptables規(guī)則:

iptables -F

3、設(shè)置默認(rèn)策略(INPUT、OUTPUT、FORWARD):

iptables -P INPUT ACCEPT

iptables -P OUTPUT ACCEPT

iptables -P FORWARD ACCEPT

4、允許來(lái)自特定IP的數(shù)據(jù)包:

iptables -A INPUT -s IP地址 -j ACCEPT

5、拒絕來(lái)自特定IP的數(shù)據(jù)包:

iptables -A INPUT -s IP地址 -j DROP

6、允許特定端口的數(shù)據(jù)包:

iptables -A INPUT -p 端口號(hào) –dport 端口號(hào) -j ACCEPT

7、拒絕特定端口的數(shù)據(jù)包:

iptables -A INPUT -p 端口號(hào) –dport 端口號(hào) -j DROP

8、保存當(dāng)前iptables規(guī)則:

service iptables save

iptables常用命令

1、查看當(dāng)前iptables規(guī)則:iptables -L -n -v

2、清空當(dāng)前iptables規(guī)則:iptables -F

3、設(shè)置默認(rèn)策略(INPUT、OUTPUT、FORWARD):iptables -P INPUT ACCEPTiptables -P OUTPUT ACCEPT、iptables -P FORWARD ACCEPT

4、允許來(lái)自特定IP的數(shù)據(jù)包:iptables -A INPUT -s IP地址 -j ACCEPT

5、拒絕來(lái)自特定IP的數(shù)據(jù)包:iptables -A INPUT -s IP地址 -j DROP

6、允許特定端口的數(shù)據(jù)包:iptables -A INPUT -p 端口號(hào) --dport 端口號(hào) -j ACCEPT

7、拒絕特定端口的數(shù)據(jù)包:iptables -A INPUT -p 端口號(hào) --dport 端口號(hào) -j DROP

8、保存當(dāng)前iptables規(guī)則:service iptables save

9、恢復(fù)默認(rèn)的iptables規(guī)則:service iptables restore

10、重啟iptables服務(wù):service iptables restart

11、查看某個(gè)規(guī)則是否存在:iptables -L | grep "規(guī)則內(nèi)容"

12、刪除某個(gè)規(guī)則:iptables -D INPUT <鏈名> <規(guī)則編號(hào)>iptables -D <鏈名> <規(guī)則編號(hào)>

13、插入某個(gè)規(guī)則:iptables -I INPUT <鏈名> <規(guī)則內(nèi)容>iptables -I <鏈名> <規(guī)則內(nèi)容>

14、修改某個(gè)規(guī)則的順序:iptables -R <鏈名> <規(guī)則編號(hào)> <新規(guī)則編號(hào)>iptables -R <鏈名> <新規(guī)則編號(hào)> <舊規(guī)則編號(hào)>

15、將某個(gè)規(guī)則添加到其他鏈中:iptables -A <目標(biāo)鏈名> <源鏈名> <規(guī)則編號(hào)>iptables -A <目標(biāo)鏈名> <源鏈名> --jump <跳轉(zhuǎn)類(lèi)型> --destination-port <目標(biāo)端口> --source-port <源端口> --protocol <協(xié)議類(lèi)型> --dport <目標(biāo)端口> --sports <源端口> --match multiport --match state --state <狀態(tài)類(lèi)型> --match comment --comment "<選項(xiàng)" --match destination --destination-address <目標(biāo)地址> --source-address <源地址> --match tcp-flags --tcp-flags <標(biāo)志位> --match packet-length --packet-length <長(zhǎng)度值> --match extension --extension <擴(kuò)展名> --match module --module <模塊名> --match owner --owner <所有者用戶(hù)ID>:<所有者組ID> --match limit --limit <限制次數(shù)> --match log-prefix --log-prefix "日志前綴" --log-level <日志級(jí)別> --log-uid <記錄用戶(hù)ID>:<記錄組ID> --log-prefix "日志前綴" --log-level <日志級(jí)別> --log-uid <記錄用戶(hù)ID>:<記錄組ID> --log-prefix "日志前綴" --log-level <日志級(jí)別> --log-uid <記錄用戶(hù)ID>:<記錄組ID>


新聞名稱(chēng):iptablescentos
URL鏈接:http://m.5511xx.com/article/cdcdpcs.html