logo
Home 特权副本 linux防火墙详解(iptables、firewalld)

linux防火墙详解(iptables、firewalld)

  • 2026-07-11 18:34:19

查看iptable各表的内容

# iptables -t mangle --list

# iptables -t raw --list

# iptables -t nat --list

# iptables -t filter --list or # iptables --list

注意:如果不指定-t选项,就只会显示默认的filter表

以下例子表明在filter表的input链, forward链, output链中存在规则:

root@server ~]# iptables --list -n

Chain INPUT (policy ACCEPT)

target prot opt source destination

ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED

ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0

ACCEPT all -- 0.0.0.0/0 0.0.0.0/0

ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22

REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-proh

Chain FORWARD (policy ACCEPT)

target prot opt source destination

REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-proh

Chain OUTPUT (policy ACCEPT)

target prot opt source destination

target – 前面提到的target的特殊值

prot – 协议:tcp, udp, icmp等

source – 数据包的源IP地址

destination – 数据包的目标IP地址

Previous Post
如何将手机与车载导航连接
Copyright © 2088 战力飙升活动特区 - 专属特权限时解锁 All Rights Reserved.
友情链接