CISCO不同VLAN的DHCP

来源:本站原创 网络技术 超过1,962 views围观 0条评论

最近在学习cisco 的packet tracer,试着在3560上为不同vlan,dhcp不同的ip地址信息。在网上查阅的一些资料都不能顺利的调试出来。现在自己写一个出来与大家分享。先上拓扑图。

试验环境为packet tracer 5.3.0.0088,灰色背景字体为输入命令。

clip_image002

以下为具体的操作步骤

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的效果图

clip_image004

文章出自:CCIE那点事 http://www.jdccie.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。 禁止全文转载。
本文标题:CISCO不同VLAN的DHCP
本文链接:http://www.jdccie.com/?p=3373转载请注明转自CCIE那点事
如果喜欢:点此订阅本站
上篇文章:
  • 相关文章
  • 为您推荐
  • 各种观点

暂时还木有人评论,坐等沙发!
发表评论

您必须 [ 登录 ] 才能发表留言!