linux防火墻配置(基于yum倉的配置)詳細步驟
前言
此實驗準備兩臺虛擬機便于調試,一臺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內容的開發(fā)者完成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區(qū)域
(1).首先看Firewalld的默認區(qū)域
[root@cento211 ~]# firewall-cmd --get-default public (是默認的public區(qū)域)
(2).使用dmz區(qū)域
[root@cento211 ~]# firewall-cmd --set-default-zone=dmz success
(3).查看此時的默認區(qū)域
[root@cento211 ~]# firewall-cmd --get-default dmz
7.打開兩臺虛擬機,分別查看虛擬機地址

8.來自子網10.1.1.0/24網段的流量路由到work區(qū)域
[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區(qū)域應打開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.網頁測試

到此這篇關于linux防火墻配置(基于yum倉的配置)詳細步驟的文章就介紹到這了,更多相關linux防火墻配置內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
linux輸入yum后提示: -bash: /usr/bin/yum: No such file or director
在本篇文章里小編給大家整理的是關于linux輸入yum后提示: -bash: /usr/bin/yum: No such file or directory的解決方法,有需要的朋友們參考下。2019-11-11
linux服務器安裝SonarQube代碼檢測工具的詳細步驟
這篇文章主要介紹了linux服務器安裝SonarQube代碼檢測工具,本文分步驟給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2022-07-07
Centos5.4+Nginx-0.8.50+UWSGI-0.9.6.2+Django-1.2.3搭建高性能WEB服務器
這篇文章主要介紹了Centos5.4+Nginx-0.8.50+UWSGI-0.9.6.2+Django-1.2.3搭建高性能WEB服務器的相關資料,需要的朋友可以參考下2016-02-02
linux下終端分屏使用的兩種方法(screen和tmux)
這篇文章主要給大家介紹了關于在linux下終端分屏使用的兩種方法,分別是利用screen和tmux,文中介紹的非常詳細,對大家具有一定的參考學習價值,需要的朋友們下面來一起看看吧。2017-06-06

