華為S5700交換機打開DHCP


eNSP新建拓撲

1、使用dis vlan命令我們可以看到交換機默認一個vlan

<Huawei>sys
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sys
[Huawei]sysname SW1
[SW1]dis
[SW1]display vl
[SW1]display vlan

2、使用默認的vlan1開啟DHCP功能,讓PC自動獲取到IP地址

[SW1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[SW1]dis this

[SW1]int
[SW1]interface vlan
[SW1]interface Vlanif 1
[SW1-Vlanif1]ip addr
[SW1-Vlanif1]ip address 192.168.1.1 24
[SW1-Vlanif1]dhcp sel
[SW1-Vlanif1]dhcp select int
[SW1-Vlanif1]dhcp select interface
[SW1-Vlanif1]dis this

此時,PC使用DHCP就可以獲取IP地址

PS: dhcp select interface 就是以“當前接口的IP與掩碼”所處的IP地址范圍作為地址池下發 無需手動指定地址范圍, 網關為當前接口IP DNS在接口下配置。dhcp select global 需要調用一個全局模式下建立的地址池(ip pool) 網關 dns等在ip pool內配置。

 3、其他設置

[SW1-Vlanif1]ip address 192.168.10.254 24
[SW1-Vlanif1]dhcp select interface

[SW1-Vlanif1]dhcp server lease day 30
[SW1-Vlanif1]dhcp server dns-list 114.114.114.114 8.8.8.8

[SW1-Vlanif1]dhcp server excluded-ip-address 192.168.10.200 192.168.10.253  //排除200-254 不分配

[SW1-Vlanif1]dis this

 

[SW1-Vlanif1]dhcp server excluded-ip-address 192.168.10.2  //排除10.2 不分配

[SW1-Vlanif1]dhcp server static-bind ip-address 192.168.10.9 mac-address 28d2-4469-5a55   // 綁定 IP  192.168.10.9 固定分配給MAC 為28d2-4469-5a55的機器

此時,PC就可以自動獲取IP地址、網關和DNS地址

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM