centos7.x Firewall-Port-process configuration

Source: Internet
Author: User
Tags firewall
System configuration directory:/usr/lib/firewalld/  User Configuration directory:/etc/firewalld/  1, Firewall firewalld basic commands: Firewall-cmd-- Version (view firewall firewall version) Firewall-cmd--state  or  systemctl status firewalld (view Firewall firewall status)          systemctl start firewalld (boot) systemctl restart Firewalld (reboot) Systemctl Stop Firewalld (stop ) systemctl disable FIREWALLD (disabled)        

  2, firewall open specify port command      The first step: you can first view the open port of this machine, command: Firewall-cmd--zone=public  --list-ports, The following figure:             Description A port is not open.       Step two: You can view the rules of the firewall first, Command: Firewall-cmd--list-all&nbsp, as shown below:                  Step three: Open the specified port through the command to open the port: Firewall-cmd--zone=public--add-port=80/tcp--permanent (add port 80 in firewall), as shown in the following figure: command meaning:--zone # Scope--add-port=80/tcp #添加端口, the format is: Port/Communication protocol--permanent #永久生效, without this parameter reboot after failure          Add success Remember to reboot the firewall Oh, command: systemctl restart Firewalld.service            at the second view added port situation, as shown in:              above firewall configuration successful, firewall open specified port configuration successful ...   3, Port command      Command 1:NETSTAT-ANTP | GREP:80 (see which service is occupied by port 80) or netstat-antpuel  | grep ": 22" | Grep  -v grep (Worry-grep itself)         Command 2:NETSTAT-ANTP | grep: (View all port occupancy)     &NBSp 4. Process command      command 1:ps aux | grep nginx (view Nginx process run state) or PS aux | grep:80 | Grep-v grep (Worry-grep itself)    

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.