脚本宝典收集整理的这篇文章主要介绍了linux防火墙配置(基于yum仓的配置)详细步骤,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
此实验准备两台虚拟机便于调试,一台CentOs6,一台红帽6
[root@cento211 yum.repos.d]# yum -y install httpd mod_ssl
[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
[root@cento211 ~]# vim /VAR/www/html/index.html Congratulation!
查看应用web页面的编辑内容
[root@cento211 ~]# cat /var/www/html/index.html Congratulation!
[root@cento211 ~]# systemctl is-enabled firewalld enabled
(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
[root@cento211 ~]# firewall-cmd --PErmanent --add-source=10.1.1.0/24 --zone=work success
[root@cento211 ~]# firewall-cmd --reload success
[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:
(1).首先打开Https服务
[root@cento211 ~]# firewall-cmd --permanent --add-service=https --zone work success
(2).重置
[root@cento211 ~]# firewall-cmd --reload success
(3).查看此服务被启用
[root@centos6-212~]# curl -k https://10.1.1.211 Congratulation!
到此这篇关于linux防火墙配置(基于yum仓的配置)详细步骤的文章就介绍到这了,更多相关linux防火墙配置内容请搜索脚本宝典以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本宝典!
以上是脚本宝典为你收集整理的linux防火墙配置(基于yum仓的配置)详细步骤全部内容,希望文章能够帮你解决linux防火墙配置(基于yum仓的配置)详细步骤所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。