Linux Firewall Iptables Open port

Source: Internet
Author: User
Tags iptables

Iptabels is a package filtering firewall system integrated with the Linux kernel, and almost all Linux distributions contain iptables functionality. If a Linux system is connected to an Internet or LAN, server, or proxy server connecting the LAN and the Internet, the Iptables facilitates better control over IP packet filtering and firewall configuration on Linux systems.

1. View open ports:
#/etc/init.d/iptables Status

2. Open port: 8080
# /sbin/iptables-i input-p tcp--dport 8080-j ACCEPT

You can also add a line directly to the/etc/sysconfig/iptables:
-A rh-firewall-1-input-m state–state new-m tcp-p tcp–dport 8080-j ACCEPT

Similarly, the other ports, as long as the replacement of 8080, the following open 22 port

#/sbin/iptables-i input-p TCP--dport 22-j ACCEPT

3. Then Save:
#/etc/rc.d/init.d/iptables Save

4. Restart the firewall for changes to take effect: (or restart the system directly)
# /etc/init.d/iptables restart

Note:

1. Turn off the firewall
# /etc/init.d/iptables stop

Or:
# Service iptables Stop # Services

2. Permanently shut down the firewall
# Chkconfig–level iptables off

This method originates from the network, not experimentally, and security considerations deny using this method

Linux Firewall Iptables Open port

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.