Home > Operation and Maintenance > Linux Operation and Maintenance > How to use iptables to open specified ports under linux

How to use iptables to open specified ports under linux

王林
Release: 2020-07-06 09:47:40
Original
19136 people have browsed it

The method to use iptables to open a specified port under Linux is: 1. Execute the [/sbin/iptables -I INPUT -p tcp --dport 8000 -j ACCEPT] command to open the port; 2. Restart the service; 3. Check whether the port is open.

How to use iptables to open specified ports under linux

Open the network port that allows external access through the following command:

Open port 8000

/sbin/iptables -I INPUT -p tcp --dport 8000 -j ACCEPT
Copy after login

Save the configuration

/etc/rc.d/init.d/iptables save
Copy after login

Restart the service

/etc/rc.d/init.d/iptables restart
Copy after login

Check whether the port is open

/etc/init.d/iptables status
Copy after login

The above is the detailed content of How to use iptables to open specified ports under linux. 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