日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

linux防火墻配置(基于yum倉的配置)詳細步驟_Linux

更新時間: 2021-12-10 編程語言

前言

此實驗準備兩臺虛擬機便于調試,一臺CentOs6,一臺紅帽6

1.首先確保yum倉的配置是否完好(CentOs6)

?2.要求在centOs6中安裝httpd和mod_ssl軟件包

[root@cento211 yum.repos.d]# yum -y install httpd mod_ssl

3.在CentOs6中啟用httpd.service并使其開機自啟

[root@cento211 ~]# systemctl enable httpd.service 
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
 
[root@cento211 ~]# systemctl start httpd.service

4.在web內容的開發者完成Web應用之前,使用Congratulation!來提供占位符頁面

[root@cento211 ~]# vim /var/www/html/index.html
 
Congratulation!

查看應用web頁面的編輯內容

[root@cento211 ~]# cat /var/www/html/index.html 
Congratulation!

5.啟用和啟動firewalld服務

[root@cento211 ~]# systemctl is-enabled firewalld
enabled

6.在CentOs6上的firewalld配置對所有未指定連接使用dmz區域

(1).首先看Firewalld的默認區域

[root@cento211 ~]# firewall-cmd --get-default 
public (是默認的public區域)

(2).使用dmz區域

[root@cento211 ~]# firewall-cmd --set-default-zone=dmz 
success

(3).查看此時的默認區域

[root@cento211 ~]# firewall-cmd --get-default 
dmz

7.打開兩臺虛擬機,分別查看虛擬機地址

8.來自子網10.1.1.0/24網段的流量路由到work區域

[root@cento211 ~]# firewall-cmd --permanent --add-source=10.1.1.0/24 --zone=work 
success

9.重置

[root@cento211 ~]# firewall-cmd --reload 
success

10.查看此時的source

[root@cento211 ~]# firewall-cmd --list-all --zone=work 
work (active)
  target: default
  icmp-block-inversion: no
  interfaces: 
  sources: 10.1.1.0/24 (這個就是我們配置的地址)
  services: dhcpv6-client ssh
  ports: 
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules:

11.work區域應打開Https需要的所有端口,并且對所有未加密的http流量進行過濾

(1).首先打開Https服務

[root@cento211 ~]# firewall-cmd --permanent --add-service=https --zone work 
success

(2).重置

[root@cento211 ~]# firewall-cmd --reload 
success

(3).查看此服務被啟用

12.在另一臺虛擬機紅帽6上查看yum倉是否完好

?

13.在紅帽6中使用curl 來對服務器進行測試,測試https://10.1.1.211

[root@centos6-212~]# curl -k https://10.1.1.211
Congratulation!

14.網頁測試

原文鏈接:https://blog.csdn.net/qq_63533962/article/details/121588867

欄目分類
最近更新