Linux Firewall Configuration

1. Open/close firewall commands under Linux
1) Permanently effective, will not be restored after restarting
Open : chkconfig iptables on

Close: chkconfig iptables off

2) Immediately effective, restore after restarting

Open : service iptables start

Close: service iptables stop

Need instructions The point is that other services under Linux can be opened and closed with the above commands.

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

modify the /etc/sysconfig/iptables file, and add the following:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
two.UBuntu close firewall
iptables -A INPUT -i !PPP0 - j ACCEPT
3. CentOS Linux firewall configuration and shutdown
Execute the "setup" command to start the text mode configuration utility, select "firewall configuration" in "select a tool", and then select the "run tool" button, the firewall configuration interface will appear, set the "Security Level" is set to "Disabled", and then select "OK".
Or use the command:
#/sbin/iptables -I INPUT -p tcp –dport 80 -j ACCEPT
#/sbin/iptables -I INPUT -p tcp –dport 22 -j ACCEPT
#/etc/rc.d/init.d/iptables save
restart like this After the computer, the firewall has opened ports 80 and 22 by default. It should not restart the computer
here :
#/etc/init.d/iptables restart
Close the firewall service:

check the firewall information:
#/etc/init.d/iptables status
Turn off the firewall service:
#/etc/init.d/iptables stop
Permanently shut down? I don't know what a permanent method:
#chkconfig –level 35 iptables off

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326706009&siteId=291194637