linux open port command

王林
Release: 2023-01-05 16:08:44
Original
32224 people have browsed it

The Linux command to open a port is [firewall-cmd --zone=public --add-port=1935/tcp --permanent]. It should be noted that we need to restart the firewall after opening the specified port.

linux open port command

#The operating environment of this article: centos 7 system, thinkpad t480 computer.

1. Open the firewall

systemctl start firewalld
Copy after login

2. Open the specified port

firewall-cmd --zone=public --add-port=1935/tcp --permanent
Copy after login

Command meaning:

--zone #scope

--add-port=1935/tcp #Add port, the format is: port/communication protocol

--permanent #Permanently effective, it will be invalid after restarting without this parameter

3. Restart the firewall

firewall-cmd --reload
Copy after login

4. Check the port number

netstat -ntlp   //查看当前所有tcp端口·
netstat -ntulp |grep 1935   //查看所有1935端口使用情况
Copy after login

Free video tutorial: linux video tutorial

The above is the detailed content of linux open port command. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template