功能说明

关于配置IP-MAC地址的绑定,防火期防火墙支持如下2种功能(透明或者路由模式均支持):

1、 简单的静态MAC-IP绑定,仅用于配置系统的ARP表项。

2、基于防火墙的MAC-IP绑定,列表之外的MAC会被防火墙拒绝访问。

一、系统MAC/IP地址绑定

      配置系统MAC/IP映射表,防止IP地址的盗用。

步骤一、配置命令如下

FortiGate#config system arp-table

FortiGate(arp-table) # edit 1

FortiGate(1) #set interface internal     //指定接口(路由模式或者VDOM为路由模式时需这条命令;透明模式或者VDOM为透明模式时,无需该命令)

FortiGate(1) #set ip 192.168.1.111                      //指定IP地址

FortiGate(1) #set mac 00:00:00:11:11:11            //指定MAC地址

FortiGate(1) #next

FortiGate(arp-table) #end

步骤二、查看当前防火墙ARP表

   FortiGate# get sys arp

   Address           Age(min)   Hardware Addr      Interface

   192.168.1.111     -          00:00:00:11:11:11 internal

二、基于防火墙的MAC/IP绑定

步骤一、binding参数设置

FortiGate#config firewall ipmacbinding setting

FortiGate(setting) #set bindthroughfw enable    //开启对需要通过防火墙的数据的过滤,指要匹配策略进行转发的数据。默认disable

FortiGate(setting) #set bindtofw enable             //开启对需要到达防火墙的数据的过滤,指对防火墙本身的访问。默认disable。

FortiGate(setting) #set undefinedhost block     //对不在ipmac表中的MAC采用的动作(默认block,拒绝)

FortiGate(setting) #end

步骤二、 设置ipmac表

FortiGate# config firewall ipmacbinding table

FortiGate(table)  #edit 1

FortiGate(1) #set ip 192.168.1.1            //设置绑定IP

FortiGate(1) #set mac 00:31:cd:4c:5d:6e     //设置绑定MAC

FortiGate(1) #set name "test"  //设置绑定条目的名称

FortiGate(1) #set status enable   //状态设置为启用

FortiGate(1) #next

FortiGate(table)  #end

步骤三、 接口下启用该功能

FortiGate#config system interface

FortiGate(interface)#edit internal          //进入需控制的接口

FortiGate(internal)#set ipmac enable   //状态设置为启用

FortiGate(internal)#end

三、功能验证

在防火墙上采用diagnose debug flow查看拒绝log信息;

FortiGate# diagnose debug enable                                                 开启debug功能

FortiGate# diagnose debug flow show console enable     开始flow的输出

FortiGate# diagnose debug flow filter add 192.168.1.1             定制过滤器,支持多种过滤;可以添加多个组合的过滤器

FortiGate# diagnose debug flow filter                                             查看过滤器的配置

FortiGate# diagnose debug flow trace start 10             定义索要跟踪数据包的数量

需要通过防火墙的数据:

FortiGate# id=13 trace_id=1 msg="vd-root received a packet(proto=1, 192.168.1.168:1->8.8.8.8:8) from internal. code=8, type="

id=13 trace_id=1 msg="allocate a new session-000a5db6"

id=13 trace_id=1 msg="find a route: flags=00000000 gw-192.168.118.1 via wan1"

id=13 trace_id=1 msg= "HWaddr-f0:de:f1:0f:85:c2 is in black list, drop"          //  IPMAC表中没有f0:de:f1:0f:85:c2记录,被拒绝

到达防火墙的数据:

FortiGate # id=13 trace_id=11 msg="vd-root received a packet(proto=1, 192.168.1.168:1->192.168.1.200:8) from internal. code=8,"

id=13 trace_id=11 msg="allocate a new session-000a5f04"

id=13 trace_id=11 msg= "HWaddr-f0:de:f1:0f:85:c2 is in black list, drop"     //  IPMAC表中没有f0:de:f1:0f:85:c2记录,被拒绝