FG2.8-489版本的WEB页面中虽然有IP和MAC地址绑定,但不能生效,只能在命令行下做,OS版本2.80-489到最新的3.0-318版本都按这种方式做。
一、开启端口的绑定功能
Fortigate-100A #config system interface
edit internal (注意此处的internal是指要做绑定的端口即
内网口,如果是300A这里就需要改成prot[1-6])
set ipmac enable
end
|
可以用show system interface internal查一下此端口的ipmac是否已经启用
(注:FG当开启绑定功能后,没有做IP和MAC地址绑定的电脑将无法上网。)
二、定义ip-mac绑定的规则
Fortigate-100A # get firewall ipmacbinding setting
bindthroughfw : disable
bindtofw : disable
undefinedhost : block
Fortigate-100A # config firewall ipmacbinding setting
(setting)#
(setting)# set bindthroughfw enable
(setting)# end
|
如果要求禁止少数,允许大多数,在这里选择undefinedhost allow,这样就可以只把那些要禁止的MAC输入绑定表里,减少手动输入的工作量。
# set undefinedhost allow (没有定义在ip-mac绑定表的IP允许通过)
(setting)# end
|
(setting接下来查看一下有没有开)
Fortigate-100A # get firewall ipmacbinding setting
bindthroughfw : enable (符合ip-mac绑定表的IP是否允许通过防火墙)
bindtofw : disable(符合ip-mac绑定表的IP是否禁止通过防火墙,
如果这一项选择enable,那绑定后更改IP的电脑ping不通防火墙的内网网关)
undefinedhost : block (没有定义在ip-mac绑定表的IP是允许还是禁止?默认是block)
|
继续,下面就进入做每台电脑的绑定步骤了。
三、定义对应的IP-mac对应表
>>config firewall ipmacbinding table
>edit 1
>set ip 192.168.1.8
>set mac 00:40:d0:57:78:13
>set name ipmac1
>set status enable
>next
>edit 2
>set ip 192.168.1.9
>set mac 00:58:d0:48:14:15
>set name ipmac2
>set status enable
>next
>
>……
>end
|
这样便绑定完毕(注:一个MAC地址可以绑定多个IP)
如果要删除某条绑定,
>config firewall ipmacbinding table
>delete 1 (此处的1为绑定表里的序号)
>end
|
但删除之后这一台仍不能上网,必须取消绑定功能
>config firewall ipmacbinding setting
>set bindthroughfw disable
>end
>
|
可以用下面的命令查看想绑定的IP和MAC有没有列在表里面
>show firewall ipmacbinding table
|
最后根据具体情况,在WEB页面里定义地址组和阻挡策略
(责任编辑:郭旭)