亚洲视频二区_亚洲欧洲日本天天堂在线观看_日韩一区二区在线观看_中文字幕不卡一区

公告:魔扣目錄網(wǎng)為廣大站長提供免費(fèi)收錄網(wǎng)站服務(wù),提交前請做好本站友鏈:【 網(wǎng)站目錄:http://www.430618.com 】, 免友鏈快審服務(wù)(50元/站),

點(diǎn)擊這里在線咨詢客服
新站提交
  • 網(wǎng)站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

從centos6升級到Centos7,防火墻命令變化了,但是還是習(xí)慣以前的iptables命令。本文記錄如何開啟iptables規(guī)則的防火墻。

 

Linux入門-Centos7防火墻

 

 

1.Centos7自帶防火墻關(guān)閉

 

  • 查看防火墻狀態(tài)
# firewall-cmd --state

not running

 

  • 停止firewall
# systemctl stop firewalld.service

 

  • 禁止firewall開機(jī)啟動
# systemctl disable firewalld.service

 

2.安裝配置iptables

 

  • 安裝
# yum install -y iptables-services

 

  • 編輯防火墻配置文件

 

這個是默認(rèn)規(guī)則

# vim /etc/sysconfig/iptables

# sample configuration for iptables service
# you can edit this manually or use system-config-firewall
# please do not ask us to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

修改規(guī)則保存退出

 

  • 重啟防火墻
# systemctl restart iptables.service      #最后重啟防火墻使配置生效

 

3.其他命令

# 設(shè)置防火墻開機(jī)啟動
# systemctl enable iptables.service     
# 禁止iptables服務(wù)
# systemctl disable iptables     
# 暫停服務(wù)
# systemctl stop iptables         
# 解除禁止iptables
# systemctl enable iptables     
# 開啟服務(wù)
# systemctl start iptables     

分享到:
標(biāo)簽:防火墻 Centos7
用戶無頭像

網(wǎng)友整理

注冊時間:

網(wǎng)站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網(wǎng)站吧!
最新入駐小程序

數(shù)獨(dú)大挑戰(zhàn)2018-06-03

數(shù)獨(dú)一種數(shù)學(xué)游戲,玩家需要根據(jù)9

答題星2018-06-03

您可以通過答題星輕松地創(chuàng)建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學(xué)四六

運(yùn)動步數(shù)有氧達(dá)人2018-06-03

記錄運(yùn)動步數(shù),積累氧氣值。還可偷

每日養(yǎng)生app2018-06-03

每日養(yǎng)生,天天健康

體育訓(xùn)練成績評定2018-06-03

通用課目體育訓(xùn)練成績評定