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+php+apache+oracle環(huán)境搭建之CentOS下安裝Apache
Linux環(huán)境是在VMware虛擬機中搭建的,重在學習,安裝的系統(tǒng)是CentOS6.5-64bit。本文主要講訴在CentOS中如何安裝APACHE。2014-08-08apache服務器一個ip(如:127.0.0.1)和多個域名(虛擬主機)的綁定
今天在學習PHP時,用的是apache服務器有這樣的一個需求:一個ip(如:127.0.0.1)和多個域名(虛擬主機)綁定,以下是我的解決方案,需要的朋友可以參考下2015-01-01Centos5.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-02linux php-cgi.exe占用cpu 100%的一次排障之旅
這篇文章主要介紹了linux php-cgi.exe占用cpu 100%的一次排障之旅,需要的朋友可以參考下2016-09-09