Linux Firewall Open port

Source: Internet
Author: User

Iptables is a firewall under Linux and is also the service name. Service iptables Status View firewall status service iptables start Firewall service iptables stop shutdown firewall ser Vice iptables restart reboot firewall firewall open specific port: ① file/etc/sysconfig/iptables② add:-ARh-firewall-1-input - MState--StateNEW - MTcp- PTcp--Dport8080 -jaccept★ Digital8080Representative Open8080Port, or you can change it to another port ★③ restart the firewall to save the firewall settings serivce iptables save view iptables rules and numbering iptables-NL --Line-numberTurn off all input FORWARD (forwards) output for all ports iptables- PINPUT Dropiptables- PFORWARD Dropiptables- POUTPUT Drop only opens APort Iptables-AINPUT- PTcp--Dport A -jAcceptiptables-AOUTPUT- PTcp--Sport A -jAccept parameter explanation: –A parameter is to add a rule –p specify what protocol, our common TCP protocol, of course, also has UDP, for example -Port Dns–dport is the destination port, when the data from the outside into the server for the destination port –sport data from the server out, then the data source port use –j is designated as ACCEPT-Receive or DROP do not receive prohibit an IP access iptables-AINPUT- PTcp- S 192.168. 1. 2 -jThe Drop–s parameter is the source (i.e.192.168. 1. 2The subsequent rejection is the drop delete rule iptables- DINPUT2Delete the input chain number2The rules

Linux Firewall Open port

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.