CISCO DHCP SNOOPING实验亲测通过

一、实验拓扑

重要提示:

按正常流程配置后,PC0和PC1并未获得IP,而是在DHCP server (Router0)中加入了 ip dhcp relay information trust-all 这条命令后,才正常。但与实际理论知识讲的不一样。 此命令是为了让DHCP服务器处理GIADDR地址为0.0.0.0(也就是获取IP地址的客户机与DHCPSERVER在同一个广播域不需要中继代理时GIADDR地址为0.0.0.0的情况)。但 从实际情况分析,PC0和PC1属于192.168.2.0网段,而DHCP SERVER是192.168.1.0网段,且实际抓包中继代理地址也不是0.0.0.0,而是192.168.2.1 192.168.2.0网段的网关地址,所以,按理不需要配置这条命令就可以获得IP,但没有成功。不知道是不是模拟器的原因?需要进一步学习。

另外:1、希望开启端口只允许1个MAC通过,大于1就对端口进行限制,没有成功。 2、希望在接入层交换机增加1条手动MAC-IP的邦定信息,以允许管理员电脑可以手动配置IP地址,没有成功。

3、希望禁止用户手工配置IP地址没有成功。

Switch(config)# ip arp inspection vlan 100,200 //在VLAN100和200中开启DAI功能 Switch(config)# ip arp inspection validate src-mac ip //以源MAC和IP检测ARP包是否合法

Switch(config)# interface gig1/1 //上连端口

Switch(config-if)# switchport trunk encapsulation dot1q Switch(config-if)# switchport mode trunk

Switch(config-if)# ip dhcp snooping trust //上连接口允许通过所有DHCP 报文 Switch(config-if)# ip arp inspection trust //上连接口不检测ARP邦定项 Switch(config-if)# interface gig2/2 //下连端口

Switch(config-if)# switchport trunk encapsulation dot1q Switch(config-if)# switchport mode trunk Switch(config-if)# ip arp inspection limit none

Switch(config-if)# ip verify source vlan dhcp-snooping //开启源地址验证

红色字体是在PT中没有敲出来的命令。

二、DHCP server (Router0)配置:

!

version 12.4

no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption !

hostname DHCPSERVER ! ! !

ip dhcp relay information trust-all ! !

ip dhcp excluded-address 192.168.1.1 ip dhcp excluded-address 192.168.2.1 !

ip dhcp pool vlan10

network 192.168.2.0 255.255.255.0 default-router 192.168.2.1 dns-server 8.8.8.8

! ! !

no ip cef no ipv6 cef ! ! ! ! ! ! ! ! ! !

no ip domain-lookup ! !

spanning-tree mode pvst ! ! ! ! ! !

interface FastEthernet0/0 no ip address duplex auto speed auto shutdown !

interface FastEthernet0/1

ip address 192.168.1.1 255.255.255.0 duplex auto speed auto !

interface Vlan1 no ip address shutdown !

ip classless

ip route 0.0.0.0 0.0.0.0 192.168.1.2 !

ip flow-export version 9

! ! ! ! ! ! !

line con 0 !

line aux 0 !

line vty 0 4 login ! ! ! end

三、核心交换机配置(3560)

!

version 12.2

no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption !

hostname Switch ! ! ! ! ! ! !

ip routing ! ! ! ! ! ! ! ! ! !

!

ip dhcp snooping vlan 10

ip dhcp snooping information option allow-untrusted ip dhcp snooping !

no ip domain-lookup ! !

spanning-tree mode pvst ! ! ! ! ! !

interface FastEthernet0/1 ip dhcp snooping trust switchport access vlan 100 switchport mode access !

interface FastEthernet0/2 ip dhcp snooping trust switchport access vlan 10 switchport mode access !

interface FastEthernet0/3 !

interface FastEthernet0/4 !

interface FastEthernet0/5 !

interface FastEthernet0/6 !

interface FastEthernet0/7 !

interface FastEthernet0/8 !

interface FastEthernet0/9 !

interface FastEthernet0/10 !

interface FastEthernet0/11 !

interface FastEthernet0/12

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4