dhcp服务器的作用域怎么创建(CCNP学习笔记-交换-DHCP协议与DHCP中继的配置实验解析)
WOLFLAB CCNP学习笔记-交换-DHCP协议与DHCP中继的配置实验解析
欢迎关注WOLFLAB网络实验室,我们定期都会更新更多关于CCNP相关的技术
WOLFLAB CCNP学习笔记-交换-DHCP协议与DHCP中继的配置实验解析
需求描述
1. 实验室交换机架登陆:
Rack 99 192.168.9.99
Rack 98 192.168.9.98
Rack 100 192.168.9.100
做实验之前,请重启设备,做完实验后,请勿保存。想要通过外网登陆机架请联系WOLFLAB,获取登陆方式。
2. 在sw1-sw2之间封装Trunk,配置R1的接口地址为1.1.1.1/24,配置R2的接口地址为1.1.1.2/24。在R1和R2上配置DHCP,默认网关分别指向R1和R2的接口地址。
SW1 SW2:
|
R3 R4: interface Ethernet0 no shutdown ip address dhcp R3#show ip inter brief Interface IP-Address OK? Method Status Protocol Ethernet0 1.1.1.2 YES DHCP up up R4#show ip inter brief Interface IP-Address OK? Method Status Protocol Ethernet0 1.1.1.101 YES DHCP up up 解析:将R3和R4的接口shutwn/no shutdown多试几次,R3 R4获取的IP地址,可能是合法的DHCP Server R1分配的,也可能是非法的DHCP Server R2分配的。 |
4. 在sw1和sw2上配置DHCP Snooping ,来解决DHCP的欺骗攻击。确保R3和R4获取的IP地址一定是合法的DHCP Server分配的地址。
SW1 SW2: ip dhcp snooping ip dhcp snooping vlan 1 interface range f0/11-12 ip dhcp snooping trust //配置SW1-SW2之间的Trunk为信任的接口 |
SW1: interface f0/1 ip dhcp snooping trust //sw1的F0/1接口连接合法的DHCP Server,配置为信任的接口。 |
R1 R2: ip dhcp relay information trust-all //让R1 R2信任被中继的DHCP的消息。 |
5. 将R3和R4的接口shutwn/no shutdown,观察R3和R4获取的ip地址。
R3 R4: interface Ethernet0 no shutdown ip address dhcp R3#show ip inter brief Interface IP-Address OK? Method Status Protocol Ethernet0 1.1.1.5 YES DHCP up up R4#show ip inter brief Interface IP-Address OK? Method Status Protocol Ethernet0 1.1.1.6 YES DHCP up up 解析:此时R3和R4获取的IP地址,一定是合法的DHCP Server R1分配的地址。 |
6. 在sw2的F0/1接口开启IP源保护。
SW2: interface FastEthernet0/1 ip verify source //开启源保护后,检查从F0/1接口收到数据包的源IP地址,与SW2上的绑定表中的IP地址是否一致,一致转发,不一致,Drop掉。 interface FastEthernet0/1 switchport mode access switchport port-security ip verify source port-security //此种方法开启源保护,检查从F0/1接口收到数据包的源IP地址与Mac地址,与SW2上的绑定表中的IP地址与Mac地址是否一致,一致转发,不一致,Drop掉。 SW2#show ip source binding //通过DHCP Snooping动态形成的绑定表 MacAddress IpAddress Lease(sec) Type VLAN Interface ------------------ --------------- ---------- ------------- ---- -------------------- 00:50:73:6B:CD:2A 1.1.1.5 86385 dhcp-snooping 1 FastEthernet0/1 00:10:7B:80:47:C5 1.1.1.6 86385 dhcp-snooping 1 FastEthernet0/2 |
7. 如果此时配置R3的接口IP地址为1.1.1.30/24,此时在R3上ping R4的地址,是否可以通信?在SW2上静态绑定,在R3上ping R4可以通信。
R3: interface Ethernet0 ip address 1.1.1.30 255.255.255.0 R3#ping 1.1.1.6 Type escape sequence to abort. ..... //此时是不通的。 |
SW2# ip source binding 0050.736b.cd2a vlan 1 1.1.1.30 interface f0/1 //静态绑定 SW2#show ip source binding MacAddress IpAddress Lease(sec) Type VLAN Interface ------------------ --------------- ---------- ------------- ---- -------------------- 00:50:73:6B:CD:2A 1.1.1.30 infinite static 1 FastEthernet0/1 00:10:7B:80:47:C5 1.1.1.6 85893 dhcp-snooping 1 FastEthernet0/2 |
8. 在sw2上启用DAI。配置R1接口的MAC地址为a.a.a,此时在R3上ping R4的地址,是否可以通信?
SW2: ip arp inspection vlan 1 04:33:53: %SW_DAI-4-DHCP_SNOOPING_DENY: 1 Invalid ARPs (Req) on Fa0/1, vlan 1.([000a.000a.000a/1.1.1.30/0000.0000.0000/1.1.1.6/04:33:53 UTC Mon Mar 1 1993]) //此时是不通的。SW2上启用DAI后,接口均变成unstrust接口,SW2检查从untrust接口收到的ARP的消息是否与SW2上的绑定表一致。 |
9. 在sw1和sw2上配置RSPAN,监控sw1的F0/1接口双向流量,在sw2上将监控流量推送至F0/10接口。
SW1: vlan 200 remote-span monitor session 1 source interface Fa0/1 monitor session 1 destination remote vlan 200 reflector-port Fa0/30 |
SW2: vlan 200 remote-span monitor session 1 source remote vlan 200 monitor session 1 destination interface f0/10 |
感谢关注WOLFLAB网络实验室,我么定期都会更新更多关于CCNP的技术
,免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com