Questions about Linux/centos unreachable ports __linux

Source: Internet
Author: User
Tags iptables

Recently, when building a CentOS service, found that 22 ports are always unavailable, and Windows Telnet 22 port is not available, under CentOS NETSTAT-LNPT Check Port 22 is not listening, so the online search solution, but none can solve.
Now gradually resolved.

One, iptables add 22 ports
1. If you want to open the 22,80,8080 port, enter the following command
/sbin/iptables-i input-p tcp–dport 80-j ACCEPT
/sbin/iptables-i input-p tcp–dport 22-j ACCEPT
/sbin/iptables-i input-p tcp–dport 8080-j ACCEPT
2. Modify the document
Vim/etc/rc.d/init.d/iptables
Add the above text
3. Save:
/etc/rc.d/init.d/iptables Save
4. View open ports:
/etc/init.d/iptables status
5. Reboot
5.1/etc/init.d/iptables Restart (temporary effective)
5.2 Chkconfig iptables off/on (permanently valid)

The above completes the add port.
Now try Telnet, first centos the local NETSTAT-LNPT check whether the port is open for listening, and if you're listening, try it.

If this is not successful, step two:
Second, restart the port
Run command:/etc/init.d/sshd restart
Many links are based on SSH links, so they need to be restarted via sshd.
Then NETSTAT-LNPT view the Port monitor.
Finally telnet succeeded.

The above is my experience to share, hope can solve your problem, thank ^_^

Tips: Order Ntsysv to have a surprise

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.