温馨提示:在命令中善用?
telnet 192.168.1.1
FG200B $ config firewall ipmacbinding setting
FG200B (setting) $ set bindthroughfw enable //开启命令
FG200B (setting) $ set bindthroughfw disable //关闭命令
FG200B (setting) $ end
FG200B $ get firewall ipmacbinding setting
Bindthroughfw : enable
Bindtofw : disable
Undefinedhost : block
FG200B $ config firewall ipmacbinding table
FG200B (table) $ edit 1 //新建一个ipmac
new entry '1' added
FG200B (1) $ set ip 192.168.254.2 //固定的ip
FG200B (1) $ set mac 00:0a:e4:3f:08:ec //对应相应mac地址
FG200B (1) $ set name test //别名
FG200B (1) $ set status enable //开启命令
FG200B (1) $ end
FG200B $ config firewall ipmacbinding table
可以查看刚编辑过的ipmac
FG200B (table) $ show
config firewall ipmacbinding table
edit 1
set ip 192.168.254.2
set mac 00:0a:e4:3f:08:ec
set name "test"
set status enable
next
end
此命令为删除相应ipmac
FG200B (table) $ delete 1
FG200B (table) $ end
将其配置应用到相应接口
FG200B $ config system interface
FG200B(interface) $ edit ?
name name
modem static 0.0.0.0 0.0.0.0 disable physical
port9 static 192.168.254.1 255.255.255.0 disable physical
port10 static 0.0.0.0 0.0.0.0 disable physical
port11 static 0.0.0.0 0.0.0.0 disable physical
port12 static 0.0.0.0 0.0.0.0 disable physical
port13 static 0.0.0.0 0.0.0.0 disable physical
port14 static 0.0.0.0 0.0.0.0 disable physical
port15 static 0.0.0.0 0.0.0.0 disable physical
port16 static 0.0.0.0 0.0.0.0 disable physical
ssl.root static 0.0.0.0 0.0.0.0 disable tunnel
switch static 0.0.0.0 0.0.0.0 disable physical
FG200B (interface) $ edit port9
FG200B (port9) $ set ipmac enable
FG200B (port9) $ end
FG200B $ quit
Auto backup config ...
至此命令就配置完成了,接下来就是针对此IP做策略了
首先登录防火墙依次展开防火墙→地址→地址→创建新的:
创建相应策略
至此用户test只能使用192.168.254.2这个IP地址上网了,就算是换做同网段的其他IP都不能上网。
客户端方面如果当时不生效禁用本地连接、注销系统、重启电脑任意方法后方可生效。