实验拓扑图:
实验图
一、一路由器为DHCP服务器
①trunk :
switchport mode trunk
int range f0/3-5
②vtp
vtp domain v
③VLAN
Vlan 10
Vlan 20
Vlan 30
Vlan 40
Vlan 50 (no vlan 50)
Vlan 60 (no vlan 60)
④添加vlan到交换机
命令:int f0/x
sw ac vlan 10
sw ac vlan 20
⑤配网关:
int f0/0.1
encapsulation dot1Q 10 (对vlan10 标签通行)
Ip add add 10.1.1.254 255.255.255.0
no shut
.
.
.
int f0/0.x
--------------------------------------------------------------------------
⑥DHCP池配置:
conf t
ip dhcp excluded-address 10.1.1.1 10.1.1.99
ip dhcp pool v10
network 10.1.1.0 255.255.255.0
default-router 10.1.1.254
dns-server 40.1.1.1
其余dhcp池同理
---------------------------------------
方式二:服务器作为 dhcp
①路由器中:
(删除配置:
no ip dhcp excluded-address 10.1.1.1 10.1.1.99
no ip dhcp pool v10)
配置DHCP中继:
int f0/0.1 (该接口需要被帮助)
ip helper-address DHCP + 服务器的IP
exit。
服务器中:配置如下
完成;