
实验环境:
操作系统:Mac OS X 10.11.5 beta 3(当时最新测试版),模拟器:GNS3 for Mac 1.4.6(当时最新版本)
注:当然,只要有思科模拟器都可以做这个实验
实验需求:
注:本实验由《DHCP snooping 多交换机(接入层+汇聚层)实例》扩展而来。
PC1/2/3分别位于VLAN 10/20/30,而DHCPServer位于VLAN 100;IOU2上有VLAN 10/20/30的SVI接口,IOU2和IOU3之间是Trunk链路。
接入层IOU3上做DHCP snooping,PC1/2/3要能通过DHCPServer获取到IP地址,DHCPServer接到了汇聚层IOU2上。
实验步骤:
DHCPServer:
conf t ip default-gateway 192.168.100.254 ip dhcp pool VLAN10 ip dhcp pool VLAN20 ip dhcp pool VLAN30 int e 0/0 |
IOU2:
conf t vlan 10,20,30,100 int e 0/0 int e 0/1 int vlan 10 int vlan 20 int vlan 30 int vlan 100 |
IOU3:
conf t vlan 10,20,30,100 ! 注意 int e 0/0 int e 1/0 int e 1/1 int e 0/1 |
测试:
PC1:
VPCS> ip dh -r DDORA IP 192.168.10.1/24 GW 192.168.10.254 VPCS> ping 192.168.10.254 84 bytes from 192.168.10.254 icmp_seq=1 ttl=255 time=0.672 ms 84 bytes from 192.168.10.254 icmp_seq=2 ttl=255 time=0.518 ms 84 bytes from 192.168.10.254 icmp_seq=3 ttl=255 time=0.573 ms 84 bytes from 192.168.10.254 icmp_seq=4 ttl=255 time=0.556 ms 84 bytes from 192.168.10.254 icmp_seq=5 ttl=255 time=0.558 ms
PC2:
VPCS> ip dhcp -r DDORA IP 192.168.20.1/24 GW 192.168.20.254 VPCS> ping 192.168.20.254 84 bytes from 192.168.20.254 icmp_seq=1 ttl=255 time=0.525 ms 84 bytes from 192.168.20.254 icmp_seq=2 ttl=255 time=0.516 ms 84 bytes from 192.168.20.254 icmp_seq=3 ttl=255 time=0.642 ms 84 bytes from 192.168.20.254 icmp_seq=4 ttl=255 time=0.793 ms 84 bytes from 192.168.20.254 icmp_seq=5 ttl=255 time=0.518 ms
PC3:
VPCS> ip dhcp -r DDORA IP 192.168.30.1/24 GW 192.168.30.254 VPCS> ping 192.168.30.254 84 bytes from 192.168.30.254 icmp_seq=1 ttl=255 time=0.546 ms 84 bytes from 192.168.30.254 icmp_seq=2 ttl=255 time=0.594 ms 84 bytes from 192.168.30.254 icmp_seq=3 ttl=255 time=0.733 ms 84 bytes from 192.168.30.254 icmp_seq=4 ttl=255 time=0.523 ms 84 bytes from 192.168.30.254 icmp_seq=5 ttl=255 time=0.630 ms
说明:
- 本例中IOU2没有开启DHCP监听功能,IOU3开启了该功能。需要注意的是int vlan 10需要配置“ip dhcp relay information trusted”命令,否则客户端将无法得到IP地址。这是因为交换机配置了(默认情况)“ip dhcp snooping information option”命令, 此时交换机会在客户端发出的DHCP请求报文中插入选项82信息。另一方面由于数据包从IOU3传到IOU2,没有经过中继代理,所以giaddr is zero。
相关链接:
【实验】DHCPv4
【实验】DHCPv6
【转】DHCP snooping详解
【实验】DHCP snooping 单交换机实例
【实验】DHCP snooping 多交换机(接入层+汇聚层)实例
发表评论?