路由器当交换机要关闭dhcp服务吗(使用交换机拦截非法DHCP服务器)

路由器当交换机要关闭dhcp服务吗(使用交换机拦截非法DHCP服务器)(1)

拓扑

较复杂的网络环境会出现有意或者无意的非法DHCP服务器,导致局域网中的设备获取到之后又无法正常访问网络,并且还容易产生相应的网络完全问题,这里使用交换机的DHCP Snooping信任功能来拦截非法的DHCP分配信息。

基本配置,AR1,用来模拟非法的DHCP Server

The device is running! <Huawei>system-view #进入系统视图 Enter system view, return user view with Ctrl Z. [Huawei]sysname AR1 #修改设备名称 [AR1]undo info-center enable #关闭信息中心提示 Info: Information center is disabled. [AR1]dhcp enable #开启dhcp功能 Info: The operation may take a few seconds. Please wait for a moment.done. [AR1]interface GigabitEthernet 0/0/0 #进入端口0/0/0 [AR1-GigabitEthernet0/0/0]ip address 10.1.1.1 24 #配置IP地址及子网掩码 [AR1-GigabitEthernet0/0/0]dhcp select interface #dhcp分配方式为端口 [AR1-GigabitEthernet0/0/0]quit #退出端口 [AR1]

基本配置,AR2,用来的DHCP Server,给内部网络设备分配IP地址

The device is running! <Huawei>system-view #进入系统视图 Enter system view, return user view with Ctrl Z. [Huawei]sysname AR2 #修改设备名称 [AR2]undo info-center enable #关闭信息中心提示 Info: Information center is disabled. [AR2]dhcp enable #开启dhcp功能 Info: The operation may take a few seconds. Please wait for a moment.done. [AR2]interface GigabitEthernet 0/0/0 #进入端口0/0/0 [AR2-GigabitEthernet0/0/0]ip address 10.2.2.1 24 #配置IP地址及子网掩码 [AR2-GigabitEthernet0/0/0]dhcp select interface #dhcp分配方式为端口 [AR2-GigabitEthernet0/0/0]quit #退出端口 [AR2]

基本的网络我们就配置完成了,将PC1和PC2的IP获取方式改为DHCP,查看下获取到的IP地址是有AR1分配的IP地址

路由器当交换机要关闭dhcp服务吗(使用交换机拦截非法DHCP服务器)(2)

路由器当交换机要关闭dhcp服务吗(使用交换机拦截非法DHCP服务器)(3)

然后在交换机上配置下,开启连接AR2端口的DHCPsnooping信任功能

The device is running! <Huawei>system-view #进入系统视图 Enter system view, return user view with Ctrl Z. [Huawei]sysname SW #修改设备名称 [SW]undo info-center enable #关闭信息中心提示 Info: Information center is disabled. [SW]dhcp enable #开启dhcp功能 Info: The operation may take a few seconds. Please wait for a moment.done. [SW]dhcp snooping enable #开启全局dhcp信任功能 [SW]interface GigabitEthernet 0/0/3 #进入端口0/0/3 ,连接PC1的 [SW-GigabitEthernet0/0/3]dhcp snooping enable #在端口上也开启dhcp信任功能 [SW-GigabitEthernet0/0/3]quit #退出端口 [SW]interface GigabitEthernet 0/0/4 #进入端口0/0/4 ,连接PC2的 [SW-GigabitEthernet0/0/4]dhcp snooping enable #在端口上也开启dhcp信任功能 [SW-GigabitEthernet0/0/4]quit #退出端口 [SW]interface GigabitEthernet 0/0/2 #进入端口0/0/2 [SW-GigabitEthernet0/0/2]dhcp snooping trusted #修改dhcp信任状态 [SW-GigabitEthernet0/0/2]quit #退出端口 [SW]

这样,我们就可以让交换机拦截非信任端口上的DHCP服务器了,查看下PC1和PC2重新获取到AR2分配的IP地址。(因为ensp的PC没有release命令,这里就关了重新开启)

路由器当交换机要关闭dhcp服务吗(使用交换机拦截非法DHCP服务器)(4)

PC1

路由器当交换机要关闭dhcp服务吗(使用交换机拦截非法DHCP服务器)(5)

PC2

很简单有效的一个小功能

最后#谢谢#

#华为#

##

DHCP Snooping是DHCP(Dynamic Host Configuration Protocol)的一种安全特性,用于保证DHCP客户端从合法的DHCP服务器获取IP地址,并记录DHCP客户端IP地址与MAC地址等参数的对应关系,防止网络上针对DHCP攻击。

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页