扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
随着我们对DHCP协议的深入了解,我们不妨动手做一下DHCP实验,来帮助我们了解DHCP的有关操作。这里我们就来讲解三个DHCP实验。近日,有朋友问我一些DHCP实验的一些问题。随便就再把DHCP的实验重新做了一次,与大家分离一下:
DHCP实验一:无DHCP代理
拓扑如下:
Router0配置如下:
!interface FastEthernet0/1ip address 192.168.1.1 255.255.255.0!ip dhcp excluded-address 192.168.0.1ip dhcp excluded-address 192.168.1.1!ip dhcp pool bapilongnetwork 192.168.0.0 255.255.255.0default-router 192.168.0.1dns-server 10.10.10.10
PC机可获取到IP地址,如图:
以上实验使用思科TP模拟器
DHCP实验二:使用DHCP中继代理
拓扑图如下:
Router1配置如下:
!ip dhcp excluded-address 10.10.10.1ip dhcp excluded-address 20.20.20.1!ip dhcp pool work1 network 10.10.10.0 255.255.255.0 default-router 10.10.10.1 dns-server 100.100.100.100 !ip dhcp pool work2 network 20.20.20.0 255.255.255.0 default-router 20.20.20.1 dns-server 100.100.100.100!interface Ethernet1/0ip address 23.1.1.2 255.255.255.0!ip route 10.10.10.0 255.255.255.0 23.1.1.1ip route 20.20.20.0 255.255.255.0 23.1.1.1
Router2配置如下:
interface Ethernet1/0ip address 10.10.10.1 255.255.255.0ip helper-address 23.1.1.2!interface Ethernet1/1ip address 23.1.1.1 255.255.255.0!interface Ethernet1/3ip address 20.20.20.1 255.255.255.0ip helper-address 23.1.1.2
DHCP实验结果如下:
PC2:R1#Interface FastEthernet0/1 assigned DHCP address 10.10.10.2, mask 255.255.255.0R4#show ip int brInterface IP-Address OK? Method Status ProtocolFastEthernet0/0 unassigned YES unset administratively down down FastEthernet0/1 10.10.10.2 YES DHCP up upPC3:R4#Interface FastEthernet0/1 assigned DHCP address 20.20.20.2, mask 255.255.255.0Interface IP-Address OK? Method Status ProtocolFastEthernet0/0 unassigned YES unset administratively down down FastEthernet0/1 20.20.20.2 YES DHCP up up
以上使用工大DY,CCNA路由版做为实验,用思科TP做这个实验时总是无法获取IP地址,故使用DY,其中的PC2为R3路由器,PC3为R4路由器,该两台路由器模拟成PC机,具体配置我就不帖出来了。
DHCP实验三:使用三层交换机
网络拓扑如下:
三层交换机配置如下:
1.!
2.interface FastEthernet0/1
3.switchport access vlan 20
4.!
5.interface FastEthernet0/2
6.switchport access vlan 30
7.!
8.interface Vlan20
9.ip address 20.20.20.1 255.255.255.0
10.!
11.interface Vlan30
12.ip address 30.30.30.1 255.255.255.0
13.!
14.ip dhcp pool work1
15.network 20.20.20.0 255.255.255.0
16.default-router 20.20.20.1
17.dns-server 100.100.100.100
18.ip dhcp pool work2
19.network 30.30.30.0 255.255.255.0
20.default-router 30.30.30.1
21.dns-server 100.100.100.100
DHCP实验结果如下:
PC4:
PC5配置如下:
以上使用思科TP做为实验工具。
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。