Serwer DHCP na routerze CISCO
Konfiguracja serwera DHCP na ruterze CISCO
Skonfigurujemy router0 do pracy jako serwer DHCP. Router0 posiada adres ip 192.168.0.1/24.
Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#ip dhcp excluded-address 192.168.0.1 192.168.0.10 Router(config)#ip dhcp pool pula_dhcp Router(dhcp-config)#network 192.168.0.0 255.255.255.0 Router(dhcp-config)#default-router 192.168.0.1 Router(dhcp-config)#dns-server 192.168.0.1 Router(dhcp-config)#end Router#
Wyjaśnienie:
ip dhcp excluded-address 192.168.0.1 192.168.0.10
wykluczenie z rozdawania adresów z zakresu 192.168.0.1 - 192.168.0.10
ip dhcp pool pula_dhcp
Stworzenie puli o nazwie pula_dhcp
network 192.168.0.0 255.255.255.0
pula jest dla sieci 192.168.0.0/24
default-router 192.168.0.1
brama 192.168.0.1
dns-server 192.168.0.1
serwer DNS 192.168.0.1
end
zakończenie konfiguracji
Inne dostępne opcje
Ustawienie nazwy domeny
Router(dhcp-config)# domain-name soisk.info
Inne przydatne polecenia
show ip dhcp binding
Sprawdzenie wydzierżawionych adresów
Router#show ip dhcp binding IP address Client-ID/ Lease expiration Type Hardware address 192.168.0.11 0004.9A40.B2A5 -- Automatic 192.168.0.12 000A.F3B5.EB34 -- Automatic 192.168.0.13 000A.415A.965E -- Automatic
show ip dhcp pool
Wyświetla informacje o puli.
Router# show ip dhcp pool Pool pula_dhcp : Utilization mark (high/low) : 100 / 0 Subnet size (first/next) : 0 / 0 Total addresses : 254 Leased addresses : 3 Excluded addresses : 1 Pending event : none 1 subnet is currently in the pool Current index IP address range Leased/Excluded/Total 192.168.0.1 192.168.0.1 - 192.168.0.254 3 / 1 / 254
show ip dhcp conflict
Wyświetla listę adresów IP w konflikcie
ip helper-address
Przekazuje zapytanie DHCP w tym przypadku na inny adres (DHCP relay). Jak widać poniżej musimy wejść w konfigurację interfejsu sieciowego.
Router(config-if)#ip helper-address 192.168.0.2
Zobacz też: [1]