Linux上iptables防火墻的基本應(yīng)用教程
iptables是Linux上常用的防火墻軟件,下面vps偵探給大家說一下iptables的安裝、清除iptables規(guī)則、iptables只開放指定端口、iptables屏蔽指定ip、ip段及解封、刪除已添加的iptables規(guī)則、設(shè)置iptables開機啟動等iptables的基本應(yīng)用。
1、安裝iptables防火墻
如果沒有安裝iptables需要先安裝,CentOS執(zhí)行:
yum install iptables -y
yum install iptables-services -y #CentOS7需安裝此iptables的service軟件包#
yum install iptables-services -y #CentOS7需安裝此iptables的service軟件包#
CentOS 7上默認(rèn)安裝了firewalld建議關(guān)閉并禁用:
systemctl stop firewalld
systemctl mask firewalld
systemctl mask firewalld
Debian/Ubuntu執(zhí)行:
apt-get install iptables -y
apt-get install iptables-persistent -y #持久化iptables規(guī)則服務(wù)#
apt-get install iptables-persistent -y #持久化iptables規(guī)則服務(wù)#










