Professional Documents
Culture Documents
防火墙包过滤、源NAT调试命令:match帮助手册
防火墙包过滤、源NAT调试命令:match帮助手册
1. 命令格式
[DPTECH-Developer-Shell] match -h
Usage: match [table] [options]
Tables include:
--pf pf_policy
--snat snat
Options include:
-s, --sip ip Source address
-d, --dip ip Destination address
-p, --proto proto Layer 4 Protocol number, eg. 6
-q, --sport port Source port
-r, --dport port Destination port
-m, --szone zone_id Source security zone
-n, --dzone zone_id Destination security zone
-i, --ifindex ifindex Packages out ifindex in snat
-b, --debug Match debug enable
2. 应用举例
1) 包过滤
一个报文从 untrust 域到 trust 域,源 IP 为 192.168.0.11,目的 IP 为 10.11.9.5,协议为
tcp(协议号 6),源端口为 2800,目的端口为 80,需要查看此条流量是否能匹配上包过
滤可以使用如下命令:
2) 源 NAT
一个报文源 IP 为 192.168.0.11,目的 IP 为 10.11.9.5,协议为 tcp(协议号 6)。源端口
为 2800.,目的端口为 80,根据路由查得此报文重 vlan-if13 口转发出设备,需要查看此
条报文是否做源 NAT,可以使用如下命令:
[DPTECH-Developer-Shell]echo "vlan 15" > /proc/net/hs_table
[DPTECH-Developer-Shell]cat /proc/net/hs_table
vlan name vlan-if15
ifindex 0x300000f
zone id 1 ,zone_priority 0
mac 00:24:ac:ff:fc:05
the device in vlan 15 is : 0x200000f
[DPTECH-Developer-Shell]
)