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