DHCP配置参数说明
生活随笔
收集整理的這篇文章主要介紹了
DHCP配置参数说明
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
DHCP配置參數說明】
實驗拓撲搭建
從DHCP自動獲取IP地址的方法:
- 1、創建DHCP地址池
- 2、在端口下創建接口DHCP
在端口下創建接口DHCP:
SW1配置參數
[SW1]vlan batch 10 20 [SW1]interface Ethernet0/0/1 [SW1-Ethernet0/0/1]display this # interface Ethernet0/0/1port link-type accessport default vlan 10 # return [SW1-Ethernet0/0/1]quit[SW1]interface Ethernet0/0/2 [SW1-Ethernet0/0/2]dis thi # interface Ethernet0/0/2port link-type accessport default vlan 20 # return [SW1-Ethernet0/0/2]quit[SW1]interface GigabitEthernet 0/0/1 [SW1-GigabitEthernet0/0/1]dis thi # interface GigabitEthernet0/0/1port link-type trunkundo port trunk allow-pass vlan 1port trunk allow-pass vlan 10 20 # return [SW1-GigabitEthernet0/0/1]AR1參數配置
[AR1]dhcp enable //全局開啟DHCP服務 [AR1]interface GigabitEthernet 0/0/0.1 [AR1-GigabitEthernet0/0/0.1]display this [V200R003C00] # interface GigabitEthernet0/0/0.1dot1q termination vid 10ip address 10.1.1.254 255.255.255.0 arp broadcast enabledhcp select interface //開啟接口DHCP服務功能dhcp server excluded-ip-address 10.1.1.1 //排除DHCP自動獲取的IP地址 (排除服務器IP地址、網關IP地址)dhcp server lease day 2 hour 2 minute 2 //設置DHCP最少租用時間(租約時間)dhcp server dns-list 202.99.192.68 (獲取DNS,網關,網段) # return [AR1-GigabitEthernet0/0/0.1]quit[AR1]interface GigabitEthernet 0/0/0.2 [AR1-GigabitEthernet0/0/0.2]display this [V200R003C00] # interface GigabitEthernet0/0/0.2dot1q termination vid 20ip address 20.1.1.254 255.255.255.0 arp broadcast enabledhcp select interfacedhcp server excluded-ip-address 20.1.1.1 dhcp server lease day 2 hour 2 minute 2 dhcp server dns-list 202.99.192.68 # return [AR1-GigabitEthernet0/0/0.2]
Pc1從接口DHCP自動獲取IP地址的數據報文過程
創建全局DHCP(創建DHCP地址池)
AR1參數配置及說明
[AR1]dhcp enable //使能DHCP功能,在配置DHCP服務器時必須先執行該命令,才能配置DHCP的其他功能并生效 [AR1]ip pool IT //設置一個名為IT的全局地址池 Info: It's successful to create an IP address pool. [AR1-ip-pool-IT]gateway-list 10.1.1.254 //設置分配的網關IP [AR1-ip-pool-IT]network 10.1.1.0 mask 255.255.255.0 //設置分配的地址網段 [AR1-ip-pool-IT]excluded-ip-address 10.1.1.253 //設置不參與自動分配的IP地址范圍 [AR1-ip-pool-IT]lease day 2 hour 2 minute 2 //設置地址池中的租用有效期限,默認為1天 [AR1-ip-pool-IT]dns-list 202.99.99.99 //設置分配的DNS服務器地址 [AR1-ip-pool-IT]display this [V200R003C00] # ip pool ITgateway-list 10.1.1.254 network 10.1.1.0 mask 255.255.255.0 excluded-ip-address 10.1.1.253lease day 2 hour 2 minute 2 dns-list 202.99.99.99 # return [AR1-ip-pool-IT]quit[AR1]ip pool HR [AR1-ip-pool-HR]dis thi [V200R003C00] # ip pool HRgateway-list 20.1.1.254 network 20.1.1.0 mask 255.255.255.0 excluded-ip-address 20.1.1.253lease day 2 hour 2 minute 2 dns-list 202.99.99.99 # return [AR1-ip-pool-HR]quit[AR1]interface GigabitEthernet 0/0/0.1 [AR1-GigabitEthernet0/0/0.1]dhcp select global //接口下使能全局方式分配地址 Warning: There are IP addresses allocated in the pool. Are you sure to delete the pool?[Y/N]:y [AR1-GigabitEthernet0/0/0.1]dis thi [V200R003C00] # interface GigabitEthernet0/0/0.1dot1q termination vid 10ip address 10.1.1.254 255.255.255.0 arp broadcast enabledhcp select global # return [AR1-GigabitEthernet0/0/0.1]quit[AR1]interface GigabitEthernet 0/0/0.2 [AR1-GigabitEthernet0/0/0.2]dhcp select global //接口下使能全局方式分配地址 Warning: There are IP addresses allocated in the pool. Are you sure to delete the pool?[Y/N]:y [AR1-GigabitEthernet0/0/0.2]display this [V200R003C00] # interface GigabitEthernet0/0/0.2dot1q termination vid 20ip address 20.1.1.254 255.255.255.0 arp broadcast enabledhcp select global # return [AR1-GigabitEthernet0/0/0.2]quit
補充說明:當DHCP在全局下和接口下同時存在的時候,DHCP接口優先于全局
總結
以上是生活随笔為你收集整理的DHCP配置参数说明的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: AHU 数据结构 最短路径 安大地图版本
- 下一篇: 查看电脑已连接无线的密码