Adding ports into the firewall

Source: Internet
Author: User

When Linux opens the firewall, you will find that it is no problem to log on to port 23 from the local computer, but if you log in to the Linux system from another PC, you will find that you are prompted with such an error:

Cannot open connection to host on port 23: Connection Failed

Because the Linux firewall is closed by default 23 port, if you allow remote login, you can switch off the firewall, or open a firewall open 23 port, as follows:

Immediate effect, fail after reboot

Open: Service iptables start

Close: Service iptables stop

Effective after reboot

Open: Chkconfig iptables on

OFF: Chkconfig iptables off

When the firewall is turned on, make the following settings to open the relevant port

Modify the/etc/sysconfig/iptables file to add the following:

-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 23-j ACCEPT

Modify the firewall configuration needs to modify/etc/sysconfig/iptables This file, if you want to open which port, add a bar inside.
-A rh-firewall-1-input-p tcp-m state--state new-m TCP--dport 80-j ACCEPT

Yes, where 80 is the port number to open, and then restart the Linux Firewall service.

Adding ports into the firewall

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: 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.