Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3338673
  • 博文数量: 1575
  • 博客积分: 19423
  • 博客等级: 上将
  • 技术积分: 16102
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-19 21:36
个人简介

专注专心

文章分类

全部博文(1575)

文章存档

2020年(10)

2018年(7)

2016年(6)

2015年(21)

2014年(32)

2013年(279)

2012年(516)

2011年(309)

2010年(260)

2009年(92)

2008年(15)

2007年(28)

我的朋友

分类: IT职场

2011-10-09 12:25:22

 

 

您所在的位置: > > > cisco 3560 DHCP服务器配置代码明细

cisco 3560 DHCP服务器配置代码明细
2010-09-27 13:19 佚名 hi.baidu.com 字号: |
一键收藏,随时查看,分享好友!

下面我们来对cisco 3560 DHCP服务器配置的具体内容进行一下介绍。那么详细的配置代码我们都做了整理,望对大家有用。

AD:

如何进行cisco 3560 DHCP服务器配置呢?这个问题可能不少朋友都不太清楚。那么现在我们就来分享一位网友的配置经验吧。下面是笔者的总结:有时候要启多个DHCP来工作。那么我们应该怎么做呢。首先我们要把交换端口关闭掉,换成L3的接口。配置上IP地址。再来设置DHCP地址池。我们要让端口f0/1上来的主机分配0网段的IP地址,让f0/2上来的主机分配1网段,那么,我们就应该配置好地址池后,在接口下用到ip help-address 来给客户端的查询指定一个服务地址。详细见配置。以下配置在真实3560上得到通过。

  1. Switch#sh run         首先我们看下运行中的cisco 3560 DHCP服务器务器清单  
  2. Switch#sh running-config   
  3. Building configuration...  
  4.  
  5. Current configuration : 1326 bytes  
  6. !  
  7. version 12.2  
  8. no service pad  
  9. service timestamps debug uptime  
  10. service timestamps log uptime  
  11. no service password-encryption  
  12. !  
  13. hostname Switch  
  14. !  
  15. !  
  16. no aaa new-model  
  17. system mtu routing 1500  
  18. ip subnet-zero  
  19. no ip domain-lookup  
  20. !  
  21. !  
  22. !  
  23. !  
  24. !  
  25. !  
  26. !  
  27. !           
  28. !           
  29. spanning-tree mode pvst  
  30. spanning-tree extend system-id  
  31. !           
  32. vlan internal allocation policy ascending  
  33. !           
  34. !           
  35. !           
  36. !           
  37. interface FastEthernet0/1  
  38. shutdown   
  39. !           
  40. interface FastEthernet0/2  
  41. !           
  42. interface FastEthernet0/3  
  43. !           
  44. interface FastEthernet0/4  
  45. !           
  46. interface FastEthernet0/5  
  47. !           
  48. interface FastEthernet0/6  
  49. !           
  50. interface FastEthernet0/7  
  51. !           
  52. interface FastEthernet0/8  
  53. !           
  54. interface FastEthernet0/9  
  55. !           
  56. interface FastEthernet0/10  
  57. !           
  58. interface FastEthernet0/11  
  59. !           
  60. interface FastEthernet0/12  
  61. !           
  62. interface FastEthernet0/13  
  63. !           
  64. interface FastEthernet0/14  
  65. !           
  66. interface FastEthernet0/15  
  67. !           
  68. interface FastEthernet0/16  
  69. !           
  70. interface FastEthernet0/17  
  71. !           
  72. interface FastEthernet0/18  
  73. !           
  74. interface FastEthernet0/19  
  75. !           
  76. interface FastEthernet0/20  
  77. !           
  78. interface FastEthernet0/21  
  79. !           
  80. interface FastEthernet0/22  
  81. !           
  82. interface FastEthernet0/23  
  83. no switchport  
  84. ip address 192.168.100.1 255.255.255.0  
  85. !           
  86. interface FastEthernet0/24  
  87. !           
  88. interface GigabitEthernet0/1  
  89. !           
  90. interface GigabitEthernet0/2  
  91. !           
  92. interface Vlan1  
  93. no ip address  
  94. !           
  95. ip classless  
  96. ip http server  
  97. ip http secure-server  
  98. !           
  99. !           
  100. !           
  101. control-plane  
  102. !           
  103. !           
  104. line con 0  
  105. line vty 0 4  
  106. login      
  107. line vty 5 15  
  108. login      
  109. !           
  110. end         
  111.            
  112.  
  113. Switch#conf t  
  114. Switch(config)#int fa 0/1                                cisco 3560 DHCP服务器配置中,进入F0/1  
  115. Switch(config-if)#no switchport                          关闭L2端口  
  116. Switch(config-if)#ip add 10.0.0.1 255.255.255.0          配置IP地址  
  117. Switch(config-if)#no sh                                  打开端口  
  118. Switch(config-if)#exi  
  119. Switch(config)#int fa 0/2  
  120. Switch(config-if)#no sw  
  121. Switch(config-if)#no switchport   
  122. Switch(config-if)#no sh  
  123. Switch(config-if)#ip add 10.0.1.1 255.255.255.0  
  124. Switch(config-if)#no sh  
  125. Switch(config-if)#exi  
  126. Switch(config)#ip dhcp pool ccna                          设置DHCP组  
  127. Switch(dhcp-config)#network 10.0.0.0 255.255.255.0        地址池  
  128. Switch(dhcp-config)#default-router 10.0.0.254             缺省路由(网关)  
  129. Switch(dhcp-config)#dns-server 202.103.24.68              DNS地址设置  
  130. Switch(dhcp-config)#lease 365                             地址租期  
  131. Switch(dhcp-config)#exi  
  132. Switch(config)#ip dhcp pool ccnp  
  133. Switch(dhcp-config)#network 10.0.1.0 255.255.255.0  
  134. Switch(dhcp-config)#default-router 10.0.1.254  
  135. Switch(dhcp-config)#dns-server 202.103.24.68  
  136. Switch(dhcp-config)#lease 365  
  137. Switch(dhcp-config)#exi  
  138. Switch(config)#ip dhcp excluded-address 10.0.0.1           不参与分配的地址  
  139. Switch(config)#ip dhcp excluded-address 10.0.0.254  
  140. Switch(config)#ip dhcp excluded-address 10.0.1.254  
  141. Switch(config)#ip dhcp excluded-address 10.0.1.1   
  142. Switch(config)#exi  
  143. Switch(config)#int fa 0/1  
  144. Switch(config-if)#ip helper-address 10.0.0.1               cisco 3560 DHCP服务器配置中需要指定帮助地址,它将默认转发给8个UDP服务  
  145. Switch(config-if)#exi  
  146. Switch(config)#int fa 0/2  
  147. Switch(config-if)#ip helper-address 10.0.1.1  
  148. Switch(config-if)#exi  
  149. Switch#sh run  
  150. Switch#sh running-config   
  151. Building configuration...  
  152.  
  153. Current configuration : 1864 bytes  
  154. !  
  155. version 12.2  
  156. no service pad  
  157. service timestamps debug uptime  
  158. service timestamps log uptime  
  159. no service password-encryption  
  160. !  
  161. hostname Switch  
  162. !  
  163. !  
  164. no aaa new-model  
  165. system mtu routing 1500  
  166. ip subnet-zero  
  167. no ip domain-lookup  
  168. ip dhcp excluded-address 10.0.0.1  
  169. ip dhcp excluded-address 10.0.0.254  
  170. ip dhcp excluded-address 10.0.1.254  
  171. ip dhcp excluded-address 10.0.1.1  
  172. !  
  173. ip dhcp pool ccna  
  174.    network 10.0.0.0 255.255.255.0  
  175.    default-router 10.0.0.254   
  176.    dns-server 202.103.24.68   
  177.    lease 365  
  178. !           
  179. ip dhcp pool ccnp  
  180.    network 10.0.1.0 255.255.255.0  
  181.    default-router 10.0.1.254   
  182.    dns-server 202.103.24.68   
  183.    lease 365  
  184. !           
  185. !           
  186. !           
  187. !           
  188. !           
  189. !           
  190. !           
  191. !           
  192. !           
  193. spanning-tree mode pvst  
  194. spanning-tree extend system-id  
  195. !           
  196. vlan internal allocation policy ascending  
  197. !           
  198. !           
  199. !           
  200. !           
  201. interface FastEthernet0/1  
  202. no switchport  
  203. ip address 10.0.0.1 255.255.255.0  
  204. ip helper-address 10.0.0.1  
  205. !           
  206. interface FastEthernet0/2  
  207. no switchport  
  208. ip address 10.0.1.1 255.255.255.0  
  209. ip helper-address 10.0.1.1  
  210. !           
  211. interface FastEthernet0/3  
  212. !           
  213. interface FastEthernet0/4  
  214. !           
  215. interface FastEthernet0/5  
  216. !           
  217. interface FastEthernet0/6  
  218. !           
  219. interface FastEthernet0/7  
  220. !           
  221. interface FastEthernet0/8  
  222. !           
  223. interface FastEthernet0/9  
  224. !           
  225. interface FastEthernet0/10  
  226. !           
  227. interface FastEthernet0/11  
  228. !           
  229. interface FastEthernet0/12  
  230. !           
  231. interface FastEthernet0/13  
  232. !           
  233. interface FastEthernet0/14  
  234. !           
  235. interface FastEthernet0/15  
  236. !           
  237. interface FastEthernet0/16  
  238. !           
  239. interface FastEthernet0/17  
  240. !           
  241. interface FastEthernet0/18  
  242. !           
  243. interface FastEthernet0/19  
  244. !           
  245. interface FastEthernet0/20  
  246. !           
  247. interface FastEthernet0/21  
  248. !           
  249. interface FastEthernet0/22  
  250. !           
  251. interface FastEthernet0/23  
  252. no switchport  
  253. ip address 192.168.100.1 255.255.255.0  
  254. !           
  255. interface FastEthernet0/24  
  256. !           
  257.  
  258. Switch#sh arp   
  259. Protocol Address          Age (min) Hardware Addr   Type   Interface  
  260. Internet 10.0.0.2                0   001a.4b58.42a9 ARPA   FastEthernet0/1  
  261. Internet 10.0.1.1                -   001e.4a0a.2042 ARPA   FastEthernet0/2  
  262. Internet 10.0.0.1                -   001e.4a0a.2041 ARPA   FastEthernet0/1  
  263. Internet 192.168.100.1           -   001e.4a0a.2043 ARPA   FastEthernet0/23  

根据上面的cisco 3560 DHCP服务器配置,现在我们只要连接到f0/1口上,那么客户端分配到的地址将是0网段的地址 ,如果连接到f 0/2口上,那么客户端将分配到1网段的地址。

help-address的说明:help-address 缺省转发的8个udp服务:time37 , tacacs49 , dns53 , boot/dhcp服务器67 , boot/dhcp客户端68 , tftp69 , netbios名字服务137, netbios数据报服务138
 

var thistid=227958; //收藏按钮 var favor_url = ''; // 如: var favor_title = 'cisco 3560 DHCP服务器配置代码明细'; // //绑定复制按钮 copy('msnqqcopy', '', '分享到MSN/QQ的链接复制成功!'); // copy('bbscopy', '[url=][u]cisco 3560 DHCP服务器配置代码明细[/u][/url]', '分享到论坛的UBB代码复制成功!');

交换机的基本配置

实训目的:掌握三层交换机的三层端口的启用方法;掌握3层交换机的互联和路由配置方法。

实训设备:CISCO 3560三层交换机2台,计算机2台。

实训内容:

1、 三层端口的启用和IP地址的配置方法

2、 三层设备间的路由配置方法

实训网络拓扑示意图:

实训步骤:

1、 按上图所示,构建网络实训环境

2、 配置交换机A

创建VLAN20,并配置VLAN20子接口地址为192.168.2.1,子网掩码为255.255.255.0,并将Fa0/1~Fa0/23号端口划分到VLAN20;

配置到192.168.1.0/24网段的路由,下一跳指向172.16.1.1地址。

3、 配置交换机B

进入交换机B的命令行,配置交换机的的主机名为SWITCHB,并配置Fa0/24接口的IP地址为172.16.1.1,子网掩码为255.255.255.252;

在交换机中创建VLAN10,并配置VLAN10子接口地址为192.168.1.1,子网掩码为255.255.255.0,并将Fa0/1~Fa0/23号端口划分到VLAN10;

配置到192.168.2.0/24网段的路由,下一跳指向172.16.1.2地址。

4、 检验配置

在PC1的命令行,执行PING 192.168.1.2命令,若能PING通,则配

置成功,2个三层交换机间实现了互联功能;为了检验路由的路由的功能,可取消路由,在进行PING测试,此时应该无法PING通。

上面是题目。。。能简单说下步骤????

交换机的以太网端口有IP地址配吗?第3问,怎么做??

刚才的配置非常好,但是我个人认为这样配置的话,可能会出现一点毛病,因为多写了一句“sw acc vlan 20”和“sw acc vlan 10”这两句是在端口下的命令,是把端口加入到vlan里面的,这两句可以删掉

可以在端口配置IP地址,在全局配置模式下打开功能ip routing

首先进入端口interface fa 0/24

然后关闭端口的二层功能no switchport

然后就可以配置端口的ip地址了,ip address 172.16.1.1 mask 255.255.255.252

问题一:

SA:

#en

#conf t

#vlan 20

#ip add 192.168.2.1 255.255.255.0

#no shu

#int range f0/1 - 23

#sw acc vlan 20

#ip routing

#int f0/24

#no sw

#ip add 172.16.1.2 255.255.255.252

#no shu

#ip route 192.168.1.0 255.255.255.0 172.16.1.1

SB:

#en

#conf t

#vlan 10

#ip add 192.168.1.1 255.255.255.0

#no shu

#int range f0/1 - 23

#sw acc vlan 10

#ip routing

#int f0/24

#no sw

#ip add 172.16.1.1 255.255.255.252

#no shu

#ip route 192.168.2.0 255.255.255.0 172.16.1.2

问题二:

上是不能给端口配置IP地址的,只能给vlan配置虚拟IP,像CISCO 2950 2960等

但是上开启三层功能以后可以给的端口配置IP地址,有转发功能 像CISCO 3560 3750等

问题三:

先开启三层交换功能

命令 ip routing

然后再进入端口配置IP,默认情况下可以直接配置,如果提示错误,使用no switchport关闭二层功能,然后配置IP即可

阅读(1474) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~