当前位置:文档之家› 神州数码交换机DHCP服务器的配置

神州数码交换机DHCP服务器的配置


switch(Config-If-Vlan100)#no shutdown
switch(Config)#interface vlan 200 switch(Config-If-Vlan200)#ip address 192.168.200.1 255.255.255.0 switch(Config-If-Vlan200)#no shutdown
switch(dhcp-testA-config)#default-router 192.168.100.1
switch(dhcp-testA-config)#dns-server 192.168.1.1
switch(dhcp-testA-config)#exit
switch(Config)#ip dhcp pool testB switch(dhcp-testB-config)#network-address 192.168.200.0 24 switch(dhcp-testB-config)#lease 1 switch(dhcp-testB-config)#default-router 192.168.200.1 switch(dhcp-testB-config)#dns-server 192.168.1.1 switch(dhcp-testB-config)#exit switch(Config)#
9-16 端口 Ipconfig/renew 192.168.200.2/24
第五步:为特殊的 PC 配置地址池 switch(Config)#ip dhcp excluded-address 192.168.100.77 192.168.100.99 switch(Config)#ip dhcp pool testC switch(dhcp-testC-config)#host 192.168.100.88 switch(dhcp-testC-config)#hardware-address 00-a0-d1-d1-07-ff switch(dhcp-testC-config)#default-router 192.168.100.1 switch(dhcp-testC-config)#exit
实验三十五、交换机 DHCP 服务器的配置
一、 实验目的
1、 了解 DHCP 原理; 2、 熟练掌握交换机作为 DHCP 服务器的配置方法; 3、 了解该功能的广泛应用。
二、 应用环境
大型网络一般都采用 DHCP 协议作为地址分配的方法,需要为网络购置多台 DHCP 服务 器放置在网络的不同位置。为减轻网络管理员和用户的配置负担,我们可以将支持 DHCP 的交换机配置成 DHCP 服务器。
缺省网关
192.168.200.1DNBiblioteka 服务器192.168.1.1
DNS 服务器
192.168.1.1
Wins 的节点类型 H-node
Lease
3天
Lease
1天
其中在 VLAN100 处,因为工作的需要,特地将一台 MAC 地址为 00-A0-D1-D1-07-FF 的机
器分配固定的 IP 地址 192.168.100.88。
VLAN
IP
端口成员
100
192.168.100.1/24
1~8
200 配置两个地址池:
192.168.200.1/24
9~16
PoolA (network 192.168.100.0)
PoolB (network 192.168.200.0 )
设备
Ip 地址
设备
Ip 地址
缺省网关
192.168.100.1
三、 实验设备
1、 DCRS-7604/6808/5526S/3926S 交换机 1 台 2、 PC 机 1-3 台 3、 Console 线 1 根 4、 直通网线若干
四、 实验拓扑
五、 实验要求
为处于不同 VLAN 的 PC 机设置 DHCP 服务器。
在交换机上划分两个基于端口的 VLAN:VLAN100,VLAN200。
八、 配置序列
switch#show run Current configuration:
hostname switch ip dhcp excluded-address 192.168.100.77 192.168.100.99 service dhcp ! Vlan 1 vlan 1 ! Vlan 100 vlan 100 ! Vlan 200 vlan 200 ! Interface Ethernet1/1 switchport access vlan 100 ! …… Interface Ethernet1/28 ! ! interface Vlan1 interface vlan 1 ip address 192.168.1.1 255.255.255.0 ! interface Vlan100 interface vlan 100 ip address 192.168.100.1 255.255.255.0 !
9-16 端口 Ipconfig/renew 192.168.200.2/24
七、 注意事项和排错
1、 先启动 DHCP 服务器; 2、 DHCP 客户机连接在交换机上,却获得不到 IP 地址。遇到这种情况请检测 DHCP Server
内是否有与交换机 VLAN 接口在一个网段的地址池,如没有则请添加该网段的地址 池; 3、 在 DHCP 服务中,动态分配 IP 地址与手工分配 IP 地址的地址池是互斥的,即如果 在一个地址池执行命令 network 和命令 host 时,只能有一个生效;并且在手工地 址池中一个地址池内只能配置一对 IP-MAC 的绑定,如果需要建立多对绑定,可以 建立多个手工地址池,在每个地址池分别配置 IP-MAC 的绑定,否则在同一地址池 内配置新的配置会覆盖旧的配置。
第三步:配置 DHCP
switch(Config)#service dhcp
!启用 DHCP
switch(Config)#ip dhcp pool testA !定义地址池
switch(dhcp-testA-config)#network-address 192.168.100.0 24
switch(dhcp-testA-config)#lease 3
第四步:验证实验。
使用“ipconfig/renew”命令在 PC 的 dos 命令行中检查是否得到了正确的 IP
设备
位置
动作
结果
PC1
1-8 端口 Ipconfig/renew 192.168.100.2/24
PC2
1-8 端口 Ipconfig/renew 192.168.100.3/24
PC3
六、 实验步骤
第一步:交换机全部恢复出厂设置,创建 vlan100 和 vlan200。 switch(Config)# switch(Config)#vlan 100 switch(Config-Vlan100)#switchport interface ethernet 0/0/1-8 !给 vlan100 加入端口 1-8 Set the port Ethernet0/0/1 access vlan 100 successfully Set the port Ethernet0/0/2 access vlan 100 successfully Set the port Ethernet0/0/3 access vlan 100 successfully Set the port Ethernet0/0/4 access vlan 100 successfully Set the port Ethernet0/0/5 access vlan 100 successfully Set the port Ethernet0/0/6 access vlan 100 successfully Set the port Ethernet0/0/7 access vlan 100 successfully Set the port Ethernet0/0/8 access vlan 100 successfully switch(Config-Vlan100)#exit switch(Config)#vlan 200 switch(Config-Vlan200)#switchport interface ethernet 0/0/9-16 !给 vlan200 加入端口 9-16 Set the port Ethernet0/0/9 access vlan 200 successfully Set the port Ethernet0/0/10 access vlan 200 successfully Set the port Ethernet0/0/11 access vlan 200 successfully Set the port Ethernet0/0/12 access vlan 200 successfully Set the port Ethernet0/0/13 access vlan 200 successfully Set the port Ethernet0/0/14 access vlan 200 successfully Set the port Ethernet0/0/15 access vlan 200 successfully Set the port Ethernet0/0/16 access vlan 200 successfully switch(Config-Vlan200)#exit switch(Config)#
! interface Vlan200
interface vlan 200 ip address 192.168.200.1 255.255.255.0 ! Interface Ethernet0 ! dhcp pool testB ip dhcp pool testB network-address 192.168.200.0 255.255.255.0 lease 1 default-router 192.168.200.1 dns-server 192.168.1.1 ! dhcp pool testA ip dhcp pool testA network-address 192.168.100.0 255.255.255.0 lease 3 default-router 192.168.100.1 dns-server 192.168.1.1 ! dhcp pool testC ip dhcp pool testC host 192.168.100.88 255.255.255.0 hardware-address 00-A0-D1-D1-07-FF default-router 192.168.100.1 ! switch#
相关主题