CISCO不同VLAN的DHCP
最近在学习cisco 的packet tracer,试着在3560上为不同vlan,dhcp不同的ip地址信息。在网上查阅的一些资料都不能顺利的调试出来。现在自己写一个出来与大家分享。先上拓扑图。
试验环境为packet tracer 5.3.0.0088,灰色背景字体为输入命令。
以下为具体的操作步骤
Switch>en
Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
Switch(vlan)#vlan 10
VLAN 10 added:
Name: VLAN0010
Switch(vlan)#vlan 20
VLAN 20 added:
Name: VLAN0020
Switch(vlan)#exit
APPLY completed.
Exiting….
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int vlan 10
%LINK-5-CHANGED: Interface Vlan10, changed state to up
Switch(config-if)#ip add 192.168.6.1 255.255.255.0
Switch(config-if)#no shut
Switch(config-if)#int vlan 20
%LINK-5-CHANGED: Interface Vlan20, changed state to up
Switch(config-if)#ip add 192.168.50.1 255.255.255.0
Switch(config-if)#no shut
Switch(config)#int fa0/1
Switch(config-if)#switchport access vlan 10
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
Switch(config-if)#no shut
Switch(config-if)#int fa0/11
Switch(config-if)#switchport access vlan 20
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
Switch(config-if)#no shut
Switch(config-if)#exit
Switch(config)#ip dhcp pool vlan10
Switch(dhcp-config)#network 192.168.6.0 255.255.255.0
Switch(dhcp-config)#dns 202.96.134.133
Switch(dhcp-config)#default 192.168.6.1
Switch(dhcp-config)#exit
Switch(config)#ip dhcp pool vlan20
Switch(dhcp-config)#network 192.168.50.0 255.255.255.0
Switch(dhcp-config)#dns 202.96.134.134
Switch(dhcp-config)#default 192.168.50.1
Switch(dhcp-config)#exit
Switch(config)#ip dhcp excluded-address 192.168.6.2 192.168.6.3
Switch(config)#ip dhcp excluded-address 192.168.50.2 192.168.50.3
最后两行为保留的ip地址。附pc2的效果图
暂时还木有人评论,坐等沙发!