DHCP端口设置命令剖析(1)


在一些DHCP服务器的配置中,少不了端口的设置。这个也是对于路由器和交换机配置来说非常核心的问题了。用一台cisco 3560来做DHCP服务器,有时候要启多个DHCP来工作。那么我们应该怎么做呢。

首先我们要把交换端口关闭掉,换成L3的接口。配置上IP地址。再来设置DHCP地址池。我们要让端口f0/1上来的主机分配0网段的IP地址,让f0/2上来的主机分配1网段,那么,我们就应该配置好地址池后,在接口下用到ip help-address 来给客户端的查询指定一个服务地址。详细见配置。以下配置在真实3560上得到通过。

  1. Switch#sh run            首先我们看下运行中的配置清单  
  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       


        


相关内容