linux 防火墙规则 备份,iptables规则备份恢复,firewalld的9个zone

这篇博客记录了在Linux系统中关闭iptables并尝试启用firewalld的过程。博主遇到了systemctl命令找不到firewalld服务的问题,并在后续尝试启动firewalld时遇到文件或目录不存在的错误。同时,展示了iptables的当前规则状态,显示系统已经接受了一些连接,但同时也阻止了部分未知和无效的流量。
摘要由CSDN通过智能技术生成

[root@zgxlinux-01 ~]# systemctl disable iptables

[root@zgxlinux-01 ~]# systemctl stop iptables

[root@zgxlinux-01 ~]# system enable fierwalld

-bash: system: 未找到命令

[root@zgxlinux-01 ~]# systemctl enable fierwalld

Failed to execute operation: No such file or directory

[root@zgxlinux-01 ~]# systemctl enable firewalld

[root@zgxlinux-01 ~]# systemctl start firewalld

[root@zgxlinux-01 ~]# iptables -nvL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)

pkts bytes target prot opt in out source destination

1041 77178 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED

0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0

83 7467 INPUT_direct all -- * * 0.0.0.0/0 0.0.0.0/0

83 7467 INPUT_ZONES_SOURCE all -- * * 0.0.0.0/0 0.0.0.0/0

83 7467 INPUT_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0

0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate INVALID

81 7323 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)

pkts bytes target prot opt in out source destination

0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED

0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0

4482 376K FORWARD_direct all -- * * 0.0.0.0/0 0.0.0.0/0

4482 376K FORWARD_IN_ZONES_SOURCE all -- * * 0.0.0.0/0 0.0.0.0/0

4482 376K FORWARD_IN_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0

81 5892 FORWARD_OUT_ZONES_SOURCE all -- * * 0.0.0.0/0 0.0.0.0/0

81 5892 FORWARD_OUT_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0

0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate INVALID

81 5892 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT 321 packets, 37610 bytes)

pkts bytes target prot opt in out source destination

766 81456 OUTPUT_direct all -- * * 0.0.0.0/0 0.0.0.0/0

Chain FORWARD_IN_ZONES (1 references)

pkts bytes target prot opt in out source destination

0 0 FWDI_public all -- ens33 * 0.0.0.0/0 0.0.0.0/0 [goto]

4482 376K FWDI_public all -- + * 0.0.0.0/0 0.0.0.0/0 [goto]

Chain FORWARD_IN_ZONES_SOURCE (1 references)

pkts bytes target prot opt in out source destination

Chain FORWARD_OUT_ZONES (1 references)

pkts bytes target prot opt in out source destination

0 0 FWDO_public all -- * ens33 0.0.0.0/0 0.0.0.0/0 [goto]

0 0 FWDO_public all -- * + 0.0.0.0/0 0.0.0.0/0 [goto]

Chain FORWARD_OUT_ZONES_SOURCE (1 references)

pkts bytes target prot opt in out source destination

Chain FORWARD_direct (1 references)

pkts bytes target prot opt in out source destination

Chain FWDI_public (2 references)

pkts bytes target prot opt in out source destination

4482 376K FWDI_public_log all -- * * 0.0.0.0/0 0.0.0.0/0

4482 376K FWDI_public_deny all -- * * 0.0.0.0/0 0.0.0.0/0

4482 376K FWDI_public_allow all -- * * 0.0.0.0/0 0.0.0.0/0

4401 370K ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0

Chain FWDI_public_allow (1 references)

pkts bytes target prot opt in out source destination

Chain FWDI_public_deny (1 references)

pkts bytes target prot opt in out source destination

Chain FWDI_public_log (1 references)

pkts bytes target prot opt in out source destination

Chain FWDO_public (2 references)

pkts bytes target prot opt in out source destination

81 5892 FWDO_public_log all -- * * 0.0.0.0/0 0.0.0.0/0

81 5892 FWDO_public_deny all -- * * 0.0.0.0/0 0.0.0.0/0

81 5892 FWDO_public_allow all -- * * 0.0.0.0/0 0.0.0.0/0

Chain FWDO_public_allow (1 references)

pkts bytes target prot opt in out source destination

Chain FWDO_public_deny (1 references)

pkts bytes target prot opt in out source destination

Chain FWDO_public_log (1 references)

pkts bytes target prot opt in out source destination

Chain INPUT_ZONES (1 references)

pkts bytes target prot opt in out source destination

76 6001 IN_public all -- ens33 * 0.0.0.0/0 0.0.0.0/0 [goto]

0 0 IN_public all -- + * 0.0.0.0/0 0.0.0.0/0 [goto]

Chain INPUT_ZONES_SOURCE (1 references)

pkts bytes target prot opt in out source destination

Chain INPUT_direct (1 references)

pkts bytes target prot opt in out source destination

Chain IN_public (2 references)

pkts bytes target prot opt in out source destination

83 7467 IN_public_log all -- * * 0.0.0.0/0 0.0.0.0/0

83 7467 IN_public_deny all -- * * 0.0.0.0/0 0.0.0.0/0

83 7467 IN_public_allow all -- * * 0.0.0.0/0 0.0.0.0/0

0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0

Chain IN_public_allow (1 references)

pkts bytes target prot opt in out source destination

2 144 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW

Chain IN_public_deny (1 references)

pkts bytes target prot opt in out source destination

Chain IN_public_log (1 references)

pkts bytes target prot opt in out source destination

Chain OUTPUT_direct (1 references)

pkts bytes target prot opt in out source destination

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值