When using some software on the server, you need to turn on the corresponding firewall port number , Let's have a brief understanding Linux Firewall port
Firewall policy
Firewall policies can be based on the source and destination addresses of traffic , Port number , agreement , Application and other information to customize , Then the firewall monitors the incoming and outgoing traffic using pre customized policy rules , If the traffic matches a policy rule , Then perform the corresponding processing , Otherwise, discard . Play a filtering role , Ensure the safety of the host .
<> see firewall Service status
systemctl status firewalld
<> open , restart , close ,firewalld.service service
1. open
service firewalld start
2. restart
service firewalld restart
3. close
service firewalld stop
4. View firewall rules
firewall-cmd --list-all # View all information firewall-cmd --list-ports # Port information only
5. Open port
Open port command :firewall-cmd --zone=public --add-port=8080/tcp --permanent
Restart firewall service :systemctl restart firewalld.service
Command meaning :
--zone # Scope --add-port=80/tcp # Add port , Format is : port / Communication protocol --permanent # Permanent effect , Without this parameter, it will be invalid after restart
for example : Open port 6380 Protocol bit tcp Permanent effect Scope is all
firewall-cmd --zone=public --add-port=6380/tcp --permanent
Open successfully !
be careful : If used Xshell After opening the firewall port for remote connection , You also need to add corresponding port rules to the firewall in Alibaba cloud server security
Technology
Daily Recommendation