Home > System Tutorial > LINUX > body text

Linux system iptables firewall service installation and activation and clearing rules tutorial

WBOY
Release: 2024-07-25 17:44:03
Original
708 people have browsed it

Linux 系统 iptables 防火墙服务安装与启用及清除规则教程

iptables is a firewall component service under Linux. Compared with Windows firewall, it has more powerful functions. Let’s take a look at the common operations of iptables in the Linux system to determine whether the Linux system has enabled the iptables service. Linux firewall starts up at startupLinux firewall starts up at startup, and tutorial to eliminate firewall rules.

1. Check whether iptables is installed

1. The firewall iptables under Linux is usually a system integrated component. It can be checked whether it is installed

Query via rpm-qa

2. If the modified component is not installed, you can install it through yuminstalliptables (must be connected to the Internet)

2. Check whether the linux firewall is turned on

1. If it is found that iptables has been installed, check whether the iptables service is running

You can pass serviceiptablesstatus as shown in the figure (if there are other components such as fail2ban, the firewall rules will also be called) and next to it is the rule chain

2. List iptables rules

If you want to view specific iptables rules, you can also enumerate the rules by entering iptables-L

3. Judge by service

Not only the method introduced earlier, but also by stopping the iptables service (as shown in the picture, OK xxx means that iptables is currently enabled)

4. If there is no information in the prompt, it means that the iptables service (process) is not enabled in the current system

3. Close iptables firewall/delete rules

1. Start Iptables manually after booting up

If you want to turn off the iptables service, you also need to check whether there is an iptables service in the chkconfig list.

2. Shutdown steps: First stop the chkconfigiptablesoff startup project, then remove it, and finally check it again

3. Clear iptables rules

If you only need to delete iptables firewall rules Linux system logs, you can delete the list rules through iptables-F (iptables-L lists the current iptables rules)

4. Delete an iptables rule, select and enter iptables-dxxxx, and start the iptables service as shown in the figure

Notes:

Pay attention to the iptables service, and there is also an ip6tables for firewalls under ipv6

The above is a tutorial on checking whether the firewall is turned on and deleting iptables rules in Linux. I hope you like it.

The above is the detailed content of Linux system iptables firewall service installation and activation and clearing rules tutorial. For more information, please follow other related articles on the PHP Chinese website!

source:itcool.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template