How to set up Linux firewall

  
                  

Question: Due to scientific research requirements, most of our departments do not use Windows system, but use Linux, very unaccustomed, a boot is a dark interface, like the legendary DOS. Fortunately, the software for doing research has instructions, but the Linux firewall is not mentioned, I am worried about worms or backdoor intrusions, how to start?

Answer: Because you didn't specify which Linux distribution, but the underlying things of Linux are basically the same, so the method that Xiaobian gives you is effective for most distributions. Linux's own firewall is called "iptables". The dark thing you said is the terminal. Open the firewall by entering the following command in the terminal:

chkconfig iptables on

If you close the firewall, enter:
chkconfig iptables off

The above two commands must restart the system. To be effective.

If you don't want to take effect immediately by rebooting the system, you can use the "service" command. The disadvantage is that the settings will be lost after rebooting the system.

The firewall is turned on:
service iptables start

Close the firewall:
service iptables stop

To set some port switches in the firewall, you can modify Edit the /etc/sysconfig/iptables file. For example, to enable SSH port 22, you can add the following:

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

In short, the "ptables" function is very powerful, so you can't make it clear here. For details, please refer to the "ptables" information.

Copyright © Windows knowledge All Rights Reserved