亚洲va中文字幕无码毛片,亚洲成a人片77777kkkk,五十路丰满中年熟女中出,无码人妻精品一区二区,天堂在线中文

幫助與文檔

當(dāng)前位置: 主頁(yè) > 系統(tǒng)相關(guān) > 正文

Centos7 iptables安裝

時(shí)間:2024/5/24 11:32:34   來(lái)源:米安網(wǎng)絡(luò)   作者:云主機(jī)配置專家   點(diǎn)擊:234次

Centos7如何安裝iptables?本教程以Centos7系統(tǒng)為例

本配置適用于centos7版本

先檢查是否安裝了iptables

Service iptables status


2.安裝iptables

yum install -y iptables


3.升級(jí)iptables

yum update iptables


4.安裝iptables-services

yum install iptables-services


禁用/停止自帶的firewalld服務(wù)

#停止firewalld服務(wù)

systemctl stop firewalld

#禁用firewalld服務(wù)

systemctl mask firewalld


配置文件路徑為:/etc/sysconfig/iptables

5.規(guī)則的寫(xiě)法:

iptables定義規(guī)則的方式比較復(fù)雜:

格式:

iptables [-t table] COMMAND chain CRETIRIA -j ACTION

-t table :3個(gè)filter nat mangle
COMMAND:定義如何對(duì)規(guī)則進(jìn)行管理

chain:指定你接下來(lái)的規(guī)則到底是在哪個(gè)鏈上操作的,當(dāng)定義策略的時(shí)候,是可以省略的

CRETIRIA:指定匹配標(biāo)準(zhǔn)

-j ACTION :指定如何進(jìn)行處理

page-break-inside: auto; page-break-before: auto; page-break-after: auto;" align="left">比如:不允許172.16.0.0/24的進(jìn)行訪問(wèn)。

iptables -t filter -A INPUT -s 172.16.0.0/16 -p udp --dport 53 -j DROP

當(dāng)然你如果想拒絕的更徹底:



比如:打開(kāi)8080端口為例子。


iptables -A INPUT -p tcp --dport 8080 -j ACCEPT

iptables -A INPUT -p tcp --dport 8080 -j ACCEPT

版權(quán)保護(hù): 本文「Centos7 iptables安裝」由 云主機(jī)配置專家 原創(chuàng),轉(zhuǎn)載請(qǐng)保留鏈接: http://www.iqcg.cn/docs/system/1003.html

聯(lián)系客服

0312-5535754

微信公眾號(hào)