Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure Firewall in centos8

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to configure firewall in centos8". In daily operation, I believe many people have doubts about how to configure firewall in centos8. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubt of "how to configure firewall in centos8". Next, please follow the editor to study!

There are many firewall management tools in Linux system, such as iptables, firewall-cmd, firewall-config and TCP-Wrapper firewall management tools. These are just firewall management tools that define firewall policies. The iptables service leaves the configured firewall policy to the netfilter network filter in the kernel.

1. Install yum install iptables-services # install iptables2, systemctl use systemctl unmask firewalld # to execute commands Unlock the service systemctl mask firewalld # next time you need to lock the service, execute systemctl start firewalld.service # start the firewall systemctl stop firewalld.service # stop the firewall systemctl reloadt firewalld.service # reload the configuration systemctl restart firewalld.service # restart the service systemctl status firewalld.service # display the status of the service systemctl enable firewalld.service # enable the service systemctl disable firewalld.service # disable the service systemctl is-enabled firewalld.service # check Check whether the service starts systemctl list-unit-files | grep enabled # View the list of started services systemctl-- failed # View the list of services that failed to start 3. Firewall-cmd uses firewall-cmd-- state # to view firewall status firewall-cmd-- reload # to update firewall rules firewall-cmd-- state # to view firewall status firewall-cmd-- reload # to reload firewall rules firewall-cmd-- list-ports # to view all open ports firewall-cmd-- list-services # to view all allowed services firewall-cmd-- get-services # to get all supported services

Regional correlation

Firewall-cmd-- list-all-zones # View all zone information firewall-cmd-- get-active-zones # View active zone information firewall-cmd-- set-default-zone=public # set public to default zone firewall-cmd-- get-default-zone # View default zone information firewall-cmd-- zone=public-- add-interface=eth0 # add interface eth0 to zone public

Interface correlation

Firewall-cmd-- zone=public-- remove-interface=eth0 # Delete the interface eth0firewall-cmd from the area public-- zone=default-- change-interface=eth0 # modify the area to which the interface eth0 belongs to defaultfirewall-cmd-- get-zone-of-interface=eth0 # View the area to which the interface eth0 belongs 4, Use case firewall-cmd-- add-port=80/tcp-- permanent # permanently add 80 port exception (global) firewall-cmd-- remove-port=80/tcp-- permanent # permanently delete 80 port exception (global) firewall-cmd-- add-port=65001-65010/tcp-- permanent # permanently add 65001-65010 exception (global) firewall-cmd-- zone=public-- add-port=80/tcp-- permanent # permanently add 80 port exception (area public) firewall-cmd- -zone=public-- remove-port=80/tcp-- permanent # permanently delete 80 port exception (area public) firewall-cmd-- zone=public-- add-port=65001-65010/tcp-- permanent # permanently add 65001-65010 exception (area public) firewall-cmd-- query-port=8080/tcp # query whether the port is open here The study on "how to configure the firewall in centos8" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report