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