🧩 Juniper 設備啟用 DHCP 伺服器方式
在 Junos OS 中,可以讓路由器或交換器充當 DHCP 伺服器(Dynamic Host Configuration Protocol), 自動為用戶端分配 IP 位址、網關與 DNS 等參數。
以下為 Juniper 官方建議的基本設定流程(適用於大多數 SRX / EX / MX 系列設備)。
⚙️ 基本設定步驟
1️⃣ 進入設定模式:
cli configure
2️⃣ 建立 DHCP address pool:
set system services dhcp pool 192.168.10.0/24 address-range low 192.168.10.10 high 192.168.10.100 set system services dhcp pool 192.168.10.0/24 default-lease-time 3600 set system services dhcp pool 192.168.10.0/24 router 192.168.10.1 set system services dhcp pool 192.168.10.0/24 name-server 8.8.8.8
3️⃣ 啟用 DHCP 伺服器介面:
set interfaces vlan unit 10 family inet address 192.168.10.1/24 set system services dhcp local-server group DHCP-GRP interface vlan.10
4️⃣ 確認設定:
show configuration system services dhcp
5️⃣ 儲存並套用設定:
commit
📘 檢查與除錯指令
- 顯示 DHCP 租約清單:
show system services dhcp binding
- 檢查服務狀態:
show log messages | match dhcp
📎 小提示
- 若為 SRX 防火牆,請確認 DHCP 服務區域已設為 trust zone。
- 若需多子網分配,可建立多個 pool 並對應不同介面。
- 如欲轉為中繼模式(DHCP relay),可使用
set forwarding-options helpers bootp。
📚 參考資料
- Juniper 官方文件:DHCP Server Configuration
- Juniper Example:Basic DHCP Server Configuration
- Juniper Documentation Portal
— WWFandy・網路設備設定筆記
沒有留言:
張貼留言