中国网管论坛's Archiver

heart_dream_fly 发表于 2006-10-24 14:02

Cisco 3550正确配置dhcp

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

页: [1]

Powered by Discuz! Archiver 6.1.0  © 1999-2008 bbs.bitsCN.com