Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Iptables file could not be found

Shulou Source: shulou.com Published: 2022-06-01 05:16:48 10月02日 Update

Today, I found that there is a server that does not have a firewall configured, there is no response to using service iptables start/stop. Then, the / etc/sysconfig/iptables file is missing.

Example of firewall configuration:

# Firewall configuration written by system-config-firewall

# Manual customization of this file is not recommended.

* filter

: INPUT ACCEPT [0:0]

: FORWARD ACCEPT [0:0]

: OUTPUT ACCEPT [0:0]

-An INPUT-m state-- state ESTABLISHED,RELATED-j ACCEPT

-An INPUT-p icmp-j ACCEPT

-An INPUT-I lo-j ACCEPT

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 22-j ACCEPT

-An INPUT-j REJECT-- reject-with icmp-host-prohibited

-A FORWARD-j REJECT-- reject-with icmp-host-prohibited

COMMIT

Resolve:

Configure a random rule: iptables-P OUTPUT ACCEPT

Service iptables save

Tags: Configuration firewall fire prevention files examples server missing rules Tianfa response service Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei macOS Microsoft Shulou Information vpn