自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

DHCP端口設(shè)置命令剖析

網(wǎng)絡(luò) 網(wǎng)絡(luò)管理
文章中,我們針對(duì)DHCP端口的一些配置內(nèi)容進(jìn)行了講解和介紹。希望本文所提供的代碼以及命令能夠給大家一些幫助。

在一些DHCP服務(wù)器的配置中,少不了端口的設(shè)置。這個(gè)也是對(duì)于路由器和交換機(jī)配置來說非常核心的問題了。用一臺(tái)cisco 3560來做DHCP服務(wù)器,有時(shí)候要啟多個(gè)DHCP來工作。那么我們應(yīng)該怎么做呢。

首先我們要把交換端口關(guān)閉掉,換成L3的接口。配置上IP地址。再來設(shè)置DHCP地址池。我們要讓端口f0/1上來的主機(jī)分配0網(wǎng)段的IP地址,讓f0/2上來的主機(jī)分配1網(wǎng)段,那么,我們就應(yīng)該配置好地址池后,在接口下用到ip help-address 來給客戶端的查詢指定一個(gè)服務(wù)地址。詳細(xì)見配置。以下配置在真實(shí)3560上得到通過。

  1. Switch#sh run            首先我們看下運(yùn)行中的配置清單  
  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       

 
        #p#

 

  1. Switch#conf t  
  2. Switch(config)#int fa 0/1                                                                 進(jìn)入F0/1  
  3. Switch(config-if)#no switchport                                                       關(guān)閉L2端口  
  4. Switch(config-if)#ip add 10.0.0.1 255.255.255.0                            配置IP地址  
  5. Switch(config-if)#no sh                                                                   打開端口  
  6. Switch(config-if)#exi  
  7. Switch(config)#int fa 0/2  
  8. Switch(config-if)#no sw  
  9. Switch(config-if)#no switchport   
  10. Switch(config-if)#no sh  
  11. Switch(config-if)#ip add 10.0.1.1 255.255.255.0  
  12. Switch(config-if)#no sh  
  13. Switch(config-if)#exi  
  14. Switch(config)#ip dhcp pool ccna                                                   設(shè)置DHCP組  
  15. Switch(dhcp-config)#network 10.0.0.0 255.255.255.0                   地址池  
  16. Switch(dhcp-config)#default-router 10.0.0.254                              缺省路由(網(wǎng)關(guān))  
  17. Switch(dhcp-config)#dns-server 202.103.24.68                             DNS地址設(shè)置  
  18. Switch(dhcp-config)#lease 365                                                       地址租期  
  19. Switch(dhcp-config)#exi  
  20. Switch(config)#ip dhcp pool ccnp  
  21. Switch(dhcp-config)#network 10.0.1.0 255.255.255.0  
  22. Switch(dhcp-config)#default-router 10.0.1.254  
  23. Switch(dhcp-config)#dns-server 202.103.24.68  
  24. Switch(dhcp-config)#lease 365  
  25. Switch(dhcp-config)#exi  
  26. Switch(config)#ip dhcp excluded-address 10.0.0.1                          不參與分配的地址  
  27. Switch(config)#ip dhcp excluded-address 10.0.0.254  
  28. Switch(config)#ip dhcp excluded-address 10.0.1.254  
  29. Switch(config)#ip dhcp excluded-address 10.0.1.1   
  30. Switch(config)#exi  
  31. Switch(config)#int fa 0/1  
  32. Switch(config-if)#ip helper-address 10.0.0.1                          指定幫助地址,它將默認(rèn)轉(zhuǎn)發(fā)給8個(gè)UDP服務(wù)  
  33. Switch(config-if)#exi  
  34. Switch(config)#int fa 0/2  
  35. Switch(config-if)#ip helper-address 10.0.1.1  
  36. Switch(config-if)#exi  
  37. Switch#sh run  
  38. Switch#sh running-config   
  39. Building configuration... 

#p#

  1. Current configuration : 1864 bytes  
  2. !  
  3. version 12.2  
  4. no service pad  
  5. service timestamps debug uptime  
  6. service timestamps log uptime  
  7. no service password-encryption  
  8. !  
  9. hostname Switch  
  10. !  
  11. !  
  12. no aaa new-model  
  13. system mtu routing 1500  
  14. ip subnet-zero  
  15. no ip domain-lookup  
  16. ip dhcp excluded-address 10.0.0.1  
  17. ip dhcp excluded-address 10.0.0.254  
  18. ip dhcp excluded-address 10.0.1.254  
  19. ip dhcp excluded-address 10.0.1.1  
  20. !  
  21. ip dhcp pool ccna  
  22.    network 10.0.0.0 255.255.255.0  
  23.    default-router 10.0.0.254   
  24.    dns-server 202.103.24.68   
  25.    lease 365  
  26. !           
  27. ip dhcp pool ccnp  
  28.    network 10.0.1.0 255.255.255.0  
  29.    default-router 10.0.1.254   
  30.    dns-server 202.103.24.68   
  31.    lease 365  
  32. !           
  33. !           
  34. !           
  35. !           
  36. !           
  37. !           
  38. !           
  39. !           
  40. !           
  41. spanning-tree mode pvst  
  42. spanning-tree extend system-id  
  43. !           
  44. vlan internal allocation policy ascending  
  45. !           
  46. !           
  47. !           
  48. !           
  49. interface FastEthernet0/1  
  50. no switchport  
  51. ip address 10.0.0.1 255.255.255.0  
  52. ip helper-address 10.0.0.1  
  53. !           
  54. interface FastEthernet0/2  
  55. no switchport  
  56. ip address 10.0.1.1 255.255.255.0  
  57. ip helper-address 10.0.1.1  
  58. !           
  59. interface FastEthernet0/3  
  60. !           
  61. interface FastEthernet0/4  
  62. !           
  63. interface FastEthernet0/5  
  64. !           
  65. interface FastEthernet0/6  
  66. !           
  67. interface FastEthernet0/7  
  68. !           
  69. interface FastEthernet0/8  
  70. !           
  71. interface FastEthernet0/9  
  72. !           
  73. interface FastEthernet0/10  
  74. !           
  75. interface FastEthernet0/11  
  76. !           
  77. interface FastEthernet0/12  
  78. !           
  79. interface FastEthernet0/13  
  80. !           
  81. interface FastEthernet0/14  
  82. !           
  83. interface FastEthernet0/15  
  84. !           
  85. interface FastEthernet0/16  
  86. !           
  87. interface FastEthernet0/17  
  88. !           
  89. interface FastEthernet0/18  
  90. !           
  91. interface FastEthernet0/19  
  92. !           
  93. interface FastEthernet0/20  
  94. !           
  95. interface FastEthernet0/21  
  96. !           
  97. interface FastEthernet0/22  
  98. !           
  99. interface FastEthernet0/23  
  100. no switchport  
  101. ip address 192.168.100.1 255.255.255.0  
  102. !           
  103. interface FastEthernet0/24  
  104. !           
  105.        
  106. Switch#sh arp   
  107. Protocol Address          Age (min) Hardware Addr   Type   Interface  
  108. Internet 10.0.0.2                0   001a.4b58.42a9 ARPA   FastEthernet0/1  
  109. Internet 10.0.1.1                -   001e.4a0a.2042 ARPA   FastEthernet0/2  
  110. Internet 10.0.0.1                -   001e.4a0a.2041 ARPA   FastEthernet0/1  
  111. Internet 192.168.100.1           -   001e.4a0a.2043 ARPA   FastEthernet0/23 

根據(jù)上面的配置,現(xiàn)在我們只要連接到f0/1口上,那么客戶端分配到的地址將是0網(wǎng)段的地址 ,如果連接到f 0/2口上,那么客戶端將分配到1網(wǎng)段的地址。

help-address的說明:

help-address 缺省轉(zhuǎn)發(fā)的8個(gè)udp服務(wù):time37 , tacacs49 , dns53 , boot/dhcp服務(wù)器67 , boot/dhcp客戶端68 , tftp69 , netbios名字服務(wù)137, netbios數(shù)據(jù)報(bào)服務(wù)138 
 

責(zé)任編輯:佟健 來源: hi.baidu.com
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)