cisco 3560 DHCP服务器配置代码明细

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

如何进行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
 

责任编辑:佟健 来源: hi.baidu.com
相关推荐

2010-09-29 16:12:09

cisco交换机DHC

2010-09-03 12:19:18

DHCP服务器dhcp配置

2010-09-26 14:52:22

DHCP Snoopi

2010-08-30 20:16:25

DHCP服务器

2011-09-07 10:44:36

DHCP服务器配置

2010-08-31 16:47:43

DHCP服务器

2010-09-25 09:23:11

2003 dhcp服务

2010-01-13 13:35:09

DHCP服务器配置

2010-09-27 11:44:14

Linux DHCP服

2010-08-26 17:12:06

DHCP服务器

2010-08-26 09:55:25

Cisco路由器DHCP

2010-08-25 21:29:05

DHCP服务器

2010-09-29 13:48:49

配置DHCP服务器

2010-08-26 15:21:13

DHCP服务器

2010-08-25 21:13:27

DHCP服务器

2010-08-26 09:33:10

DHCP服务器

2010-08-04 14:25:47

路由器配置

2012-12-10 09:46:05

Cisco路由器dhcp服务

2010-09-02 14:09:06

LinuxDHCP服务器

2011-08-16 10:50:35

DHCP路由器配置
点赞
收藏

51CTO技术栈公众号