注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 网络工程师职业规划--让你..
 帮助

Cisco 3550配置DHCP实例


2007-12-15 20:53:55
Cisco 3550配置dhcp,网络上多有讨论,但大都存在错漏,按照网上介绍的配置一句“IP HELPER-ADDRESS DHCP服务器地址”后,工程当中发现客户机不能从DHCP服务器获取IP地址,本人最近也刚好配置了3550作为DHCP服务器中继代理,最初也曾困惑 很久,后来在网上查找资料及在论坛上寻求众人帮助,终于在工程当中测试通过,为避免大家在工程当中遇到此类情况左调右调,特将配置过程写出来,给大家作为 参考。  
网络环境:一台3550EMI交换机,划分三个 vlan,vlan2 为服务器所在网络,命名为server,IP地址段为192.168.2.0,子网掩码:255.255.255.0,网关:192.168.2.1,域 服务器为windows 2000 advance server,同时兼作DHCP服务器,DNS服务器,IP地址为192.168.2.10,vlan3为客户机1所在网络,IP地址段为 192.168.3.0,子网掩码:255.255.255.0,网关:192.168.3.1命名为work01,vlan4 为客户机2所在网络,命名为work02,IP地址段为192.168.4.0,子网掩码:255.255.255.0,网关:192.168.4.1.
3550上端口1-8划到VLAN 2,端口9-16划分到VLAN 3,端口17-24划分到VLAN 4.
 
配置命令及步骤如下:
第一步:创建VLAN
Switch>Vlan Database
Switch(Vlan)>Vlan 2 Name server
Switch(Vlan)>Vlan 3 Name work01
Switch(vlan)>Vlan 4 Name work02
 
第二步:启用DHCP中继代理
/*关键一步,若缺少以下两条命令,在VLAN中使用“IP HELPER-ADDRESS DHCP服务器地址”指定DHCP服务器,客户机仍然不能获得IP地址*/
Switch>Enable
Switch#Config t
Switch(Config)Service Dhcp
Switch(Config)Ip Dhcp Relay Information Option
 
第三步:设置VLAN IP地址
Switch(Config)>Int Vlan 2
Switch(Config-vlan)Ip Address 192.168.2.1 255.255.255.0
Switch(Config-vlan)No Shut
Switch(Config-vlan)>Int Vlan 3
Switch(Config-vlan)Ip Address 192.168.3.1 255.255.255.0
Switch(Config-vlan)No Shut
Switch(Config-vlan)>Int Vlan 4
Switch(Config-vlan)Ip Address 192.168.4.1
255.255.255.0
Switch(Config-vlan)No Shut
Switch(Config-vlan)Exit
/*注意:由于此时没有将端口分配置到VLAN2,3,4,所以各VLAN会DOWN掉,待将端口分配到各VLAN后,VLAN会起来*/
 
第四步:设置端口全局参数
Switch(Config)Interface Range Fa 0/1 - 24
Switch(Config-if-range)Switchport Mode Access
Switch(Config-if-range)Spanning-tree Portfast
 
第五步:将端口添加到VLAN2,3,4中
/*将端口1-8添加到VLAN 2*/
Switch(Config)Interface Range Fa 0/1 - 8
Switch(Config-if-range)Switchport Access Vlan 2
/*将端口9-16添加到VLAN 3*/
Switch(Config)Interface Range Fa 0/9 - 16
Switch(Config-if-range)Switchport Access Vlan 3
/*将端口17-24添加到VLAN 4*/
Switch(Config)Interface Range Fa 0/17 - 24
Switch(Config-if-range)Switchport Access Vlan 4
Switch(Config-if-range)Exit
/*经过这一步后,各VLAN会起来*/
 
第六步:在VLAN3和4中设定DHCP服务器地址
/*VLAN 2中不须指定DHCP服务器地址*/
Switch(Config)Int Vlan 3
Switch(Config-vlan)Ip Helper-address 192.168.2.10
Switch(Config)Int Vlan 4
Switch(Config-vlan)Ip Helper-address 192.168.2.10
 
第七步:启用路由
/*路由启用后,各VLAN间主机可互相访问,若需进一步控制访问权限,则需应用到访问控制列表*/
Switch(Config)Ip Routing
 
第八步:结束并保存配置
Switch(Config-vlan)End
Switch#Copy Run Start



转载:http://matthewyin.blog.51cto.com/49294/55288


上一篇 LVS配置指南  下一篇 sopcast安装指南



    文章评论
 
2007-12-22 16:26:20
我在3560上配过DHCP中转,好像需要配置:
ip dhcp-server x.x.x.x
否则client得不到IP地址。

2007-12-24 13:15:22
ip helper-address命令吗?
不太清楚3560里怎么实现的,楼上的可以说一下吗

2007-12-24 13:34:15
一些资料关于ip dhcp-server命令,可能是3560系列的特定命令吧。

The command is used to unicast DHCP requests to a DHCP server when the router is originating DHCP packets itself. An example would be if there is a PPP link trying to negotiate the address via IPCP, a router can then take those IPCP negotiations and forward them to a DHCP server for address assignment with a config similar to that below:

R4 is getting the DHCP serverd address, R3 is translating an IPCP in to DHCP request, and R2 is serving the address.

R4
interface Serial0/1
ip address negotiated
encapsulation ppp
!
R3
ip dhcp-server 10.1.12.2
interface Serial0/1
ip address 10.1.33.3 255.255.255.0
encapsulation ppp
peer default ip address dhcp
clockrate 128000

R2
ip dhcp pool pool2
network 10.1.33.0 255.255.255.0

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: