1. 程式人生 > >Cisco路由器 配置DHCP

Cisco路由器 配置DHCP

//1.進入全域性配置檢視
router#config t

//2.開啟DHCP服務
router(config)#service DHCP

//可選:關閉DHCP衝突日誌
router(config)#no ip dhcp conflict logging

//3.配置DHCP地址池名稱(本例為:myPool)
router(config)#ip dhcp pool myPool

//4.配置DHCP地址(本例為:192.168.1.0/24)
router(dhcp-config)#network 192.168.1.0 255.255.255.0

//5.配置DHCP預設閘道器(本例為:192.168.1.1)
router(dhcp-config)#default-router 192.168.1.1

//6.配置DHCP DNS
router(dhcp-config)#dns-server 192.168.1.1

//7.退出DHCP配置
router(dhcp-config)#exit

//8.配置排除地址段
router(config)#ip dhcp excluded-address 192.168.0.1 192.168.0.10

//9.配置Ethernet0/0為192.168.0.1/24的閘道器
router(config)#interface e0/0

//10.配置Ethernet0/0 IP地址
router(config-if)ip address 192.168.1.1 255.255.255.0

//相鄰路由器可以通過進入對應介面, 通過:ip address dhcp獲得IP地址