How to add ports under CentOS


CentOS only has 22 ports by default. If you want to use other ports, you need to add them by yourself. There are all kinds of ports on the Internet. Some of them haven’t been fixed for half a day. Here’s the way for bloggers to succeed in their own experiments:

Add port: ා / SBIN / iptables – I input – P TCP — dport port number – J accept

Save settings: ා / etc / rc.d/init.d/iptables save

Check whether it is added successfully: ා / etc / init.d/iptables status| grep TCP