Detailed steps for Linux firewall configuration (based on yum warehouse configuration)

Detailed steps for Linux firewall configuration (based on yum warehouse configuration)

Preface

This experiment prepares two virtual machines for debugging, one CentOs6 and one Red Hat 6

1. First, make sure that the configuration of the yum warehouse is intact (CentOs6)

2. Requires installation of httpd and mod_ssl packages in centOs6

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

3. Enable httpd.service in CentOs6 and enable it to start automatically

[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. Use Congratulation! before web content developers complete their web applications. To provide a placeholder page

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

View the edited content of the application web page

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

5. Enable and start firewalld service

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

6. Firewalld configuration on CentOs6 uses dmz zone for all unspecified connections

(1) First, look at the default area of ​​Firewalld

[root@cento211 ~]# firewall-cmd --get-default 
public (the default public zone)

(2) Use the DMZ area

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

(3) Check the default area at this time

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

7. Open two virtual machines and check the virtual machine addresses respectively

8. Traffic from subnet 10.1.1.0/24 is routed to the work area

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

9. Reset

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

10. Check the source at this time

[root@cento211 ~]# firewall-cmd --list-all --zone=work 
work (active)
  target: default
  icmp-block-inversion: no
  interfaces: 
  sources: 10.1.1.0/24 (this is the address we configured)
  services: dhcpv6-client ssh
  ports: 
  Protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  Rich rules:

11. The work area should open all ports required by Https and filter all unencrypted http traffic

(1) First, open the Https service

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

(2) Reset

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

(3) Check whether this service is enabled

12. Check whether the yum warehouse is intact on another virtual machine Red Hat 6

13. Use curl to test the server in Red Hat 6, test https://10.1.1.211

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

14. Web page testing

This is the end of this article about the detailed steps of Linux firewall configuration (configuration based on yum warehouse). For more relevant Linux firewall configuration content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to configure Linux firewall and open ports 80 and 3306
  • A brief analysis of Linux to check the firewall status and the status of the ports open to the outside world
  • How to modify firewall configuration in Linux system
  • Detailed explanation of Linux iptables common firewall rules

<<:  Example of implementing translation effect (transfrom: translate) with CSS3

>>:  Solution to the problem that input in form cannot be submitted when disabled

Recommend

Tutorial on installing Odoo14 from source code on Ubuntu 18.04

Table of contents Background of this series Overv...

How to install Tomcat-8.5.39 on centos7.6

Here is how to install Tomcat-8.5.39 on centos7.6...

Detailed explanation of virtual DOM in Vue source code analysis

Why do we need virtual dom? Virtual DOM is design...

How to build svn server in linux

1: Install SVN yum install -y subversion 2. Creat...

How to deploy Tencent Cloud Server from scratch

Since this is my first post, if there are any mis...

Three common style selectors in html css

1: Tag selector The tag selector is used for all ...

Introduction to JavaScript strict mode use strict

Table of contents 1. Overview 1.1 What is strict ...

Summary of SQL deduplication methods

When using SQL to extract data, we often encounte...

Reasons and solutions for MySQL failing to create foreign keys

When associating two tables, a foreign key could ...

WeChat applet implements a simple calculator

A simple calculator written in WeChat applet for ...

How to configure path alias for react scaffolding

The react version when writing this article is 16...

A comparison between the href attribute and onclick event of the a tag

First of all, let's talk about the execution ...

Example of how rem is adapted for mobile devices

Preface Review and summary of mobile terminal rem...

How to use multi-core CPU to speed up your Linux commands (GNU Parallel)

Have you ever had the need to compute a very larg...

Full analysis of MySQL INT type

Preface: Integer is one of the most commonly used...