iptables open ports

1, find the configuration file

vi /etc/sysconfig/iptables  

 

2. Add port open, add a line, open port 18081

-A INPUT -m state --state NEW -m tcp -p tcp --dport 18081 -j ACCEPT

 

3, save

ESC
:wq!

 

4. Restart the service

service iptables restart

 

5. Parameter explanation:

-A: Specify the chain name   
-p: specify the protocol type   
-d: specify the destination address   
--dport: Specify the destination port (destination port destination port)   
--sport: Specify the source port (source port source port)   
-j: specify the action type  

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327097658&siteId=291194637