代码示例:IP dhcp snooping配置(1)(2)
2、静态IP dhcp snooping和IP Source Guard
- clock timezone WST 8
- switch 1 provision ws-c3750g-48ts
- system mtu routing 1500
- ip subnet-zero
- !
- ip dhcp snooping vlan 1 (指定DHCP snooping防护的vlan)
- ip dhcp snooping information option allow-untrusted
- ip dhcp snooping database flash:snooping 指定数据库路径)
- ip dhcp snooping database write-delay 15
- ip dhcp snooping (启动DHCP snooping)
- !
- !
- !
- interface GigabitEthernet1/0/45 启动IP Source Guard的端口)
- switchport mode access
- switchport port-security
- switchport port-security violation restrict
- spanning-tree portfast
- ip verify source port-security
- (ip verify source port-security是配合启动IP soure binding使用
- ip source binding 000A.E439.5F55 vlan 1 192.168.1.200 interface Gi1/0/45,说明ip source binding和动态DHCP不能同时用)
- !
- !
- interface Vlan1
- ip address 192.168.1.1 255.255.255.0
- !
- ip classless
- ip http server
- ip http secure-server
- !
- !
- ip source binding 000A.E439.5F55 vlan 1 192.168.1.200 interface Gi1/0/45
- !
- control-plane
- !
- !
- 注意使用如下命令查看工作状态:
- Switch#sh ip ver source
- Switch#sh ip dhcp binding
- Switch#sh ip dhcp snooping binding
评论暂时关闭