PG1X WIKI

My Knowledge Base

User Tools

Site Tools


tech:network:cisco:dhcp:dhcp

Cisco: DHCP

configure terminal
!
service dhcp
!
ip dhcp excluded-address ip-address | last-ip-address
!
end
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int f0/0
R1(config-if)#ip addre
R1(config-if)#ip address 10.0.8.254 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int f0
*Jul 16 08:37:28.603: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#int f0/1
R1(config-if)#ip add
R1(config-if)#ip address 10.0.4.254 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ping 
*Jul 16 08:37:47.519: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Jul 16 08:37:48.519: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R1(config-if)#do ping 10.0.4.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.4.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
R1(config-if)#do ping 10.0.4.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.4.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
R1(config-if)#int f0/0
R1(config-if)#shut
R1(config-if)#exit
R1(config)#
*Jul 16 08:41:04.055: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
*Jul 16 08:41:05.055: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
R1(config)#ser
R1(config)#servicevi
R1(config)#servic   
R1(config)#service dh
R1(config)#service dhcp 
R1(config)#ip dh
R1(config)#ip dhcpex
R1(config)#ip dhcp ex
R1(config)#ip dhcp excluded-address 10.0.8.250 10.0.8.254
R1(config)#ip dhcp excluded-address 10.0.8.1 10.0.8.10   
R1(config)#do sh run -=[]\';;ll:?
LINE    <cr>

R1(config)#do sh ru              
R1(config)#do sh run 
Building configuration...

Current configuration : 1125 bytes
!
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
dot11 syslog
ip source-route
!
!
!
ip dhcp excluded-address 10.0.8.250 10.0.8.254
ip dhcp excluded-address 10.0.8.1 10.0.8.10
!
!
ip cef
no ip domain lookup
no ipv6 cef
!
multilink bundle-name authenticated
!
crypto pki token default removal timeout 0
!
!
!
!
license udi pid CISCO1841 sn FHK1107102U
!
redundancy
!
!
! 
!
!
!
          
R1(config)#ip dh
R1(config)#ip dhcp po
R1(config)#ip dhcp pool SALES
R1(dhcp-config)#netwo
R1(dhcp-config)#network 10.0.8.0 /?
  <0-32>  Length of prefix mask

R1(dhcp-config)#network 10.0.8.0/24 
                                ^
% Invalid input detected at '^' marker.

R1(dhcp-config)#network 10.0.8.0 /24
R1(dhcp-config)#no network 10.0.8.0 /24
R1(dhcp-config)#network 10.0.8.0 255.255.255.0
R1(dhcp-config)#defau
R1(dhcp-config)#default-router 10.0.8.254
R1(dhcp-config)#dn
R1(dhcp-config)#dns-server 8.8.8.8 8.8.4.4 1.1.1.1
R1(dhcp-config)#do
R1(dhcp-config)#domain-name lab.pg1x.net
R1(dhcp-config)#lea
R1(dhcp-config)#lease inif
R1(dhcp-config)#lease infi
R1(dhcp-config)#lease infinite 
R1(dhcp-config)#no lease infinite 
R1(dhcp-config)#lea
R1(dhcp-config)#lease 7 ?
  <0-23>  Hours
  <cr>

R1(dhcp-config)#lease 7 12
R1(dhcp-config)#exit
R1(config)#ip dh
R1(config)#ip dhcp da
R1(config)#ip dhcp database ?
  WORD  Uniform Resource Locator (URL)

R1(config)#ip dhcp database tftp://10.1.2.3/ ti
R1(config)#ip dhcp database tftp://10.1.2.3/ timeout ?
  <0-3600>  Seconds

R1(config)#ip dhcp database tftp://10.1.2.3/ timeout 1 wri
R1(config)#ip dhcp database tftp://10.1.2.3/ timeout 1 writ
R1(config)#ip dhcp database tftp://10.1.2.3/ timeout 123 ? 
  <cr>

R1(config)#ip dhcp database tftp://10.1.2.3/ wri         
R1(config)#ip dhcp database tftp://10.1.2.3/ write-delay 12
R1(config)#do sh run | i dhcp                              
ip dhcp excluded-address 10.0.8.250 10.0.8.254
ip dhcp excluded-address 10.0.8.1 10.0.8.10
ip dhcp pool SALES
R1(config)#do sh run all | i dhcp
ip nbar port-map dhcp udp 67 68 
ip dhcp relay information policy replace
ip dhcp relay information check
ip dhcp use class
ip dhcp use vrf connected
ip dhcp binding cleanup interval 120
ip dhcp compatibility suboption link-selection cisco
ip dhcp conflict logging
ip dhcp excluded-address 10.0.8.250 10.0.8.254
ip dhcp excluded-address 10.0.8.1 10.0.8.10
ip dhcp ping packets 2
ip dhcp ping timeout 500
ip dhcp pool SALES
ip dhcp-server query lease retries 2
ip dhcp-server query lease timeout 10
 ip dhcp-client broadcast-flag
ip dhcp-client default-router distance 254
ipv6 dhcp ping packets 0
ipv6 dhcp server join all-dhcp-servers
R1(config)#no ip dh
R1(config)#no ip dhcp confli
R1(config)#no ip dhcp conflict logg
R1(config)#no ip dhcp conflict logging 
R1(config)#do sh run | i dhcp          
no ip dhcp conflict logging
ip dhcp excluded-address 10.0.8.250 10.0.8.254
ip dhcp excluded-address 10.0.8.1 10.0.8.10
ip dhcp pool SALES
R1(config)#int f0/0
R1(config-if)#no shut
R1(config-if)#
*Jul 16 08:51:43.379: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Jul 16 08:51:44.379: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)#debu
R1(config)#debuip dh
R1(config)#^Z       
R1#debu
R1#debug 
*Jul 16 08:51:59.339: %SYS-5-CONFIG_I: Configured from console by console
R1#debug ip dhc
R1#debug ip dhcp pa
R1#debug ip dhcp pac
R1#debug ip dhcp ?  
  server  DHCP server activity

R1#debug ip dhcp ser
R1#debug ip dhcp server pa
R1#debug ip dhcp server packet 
DHCP server packet debugging is on.
R1#sh ip dhcp pool

Pool SALES :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0 
 Total addresses                : 254
 Leased addresses               : 0
 Pending event                  : none
 1 subnet is currently in the pool :
 Current index        IP address range                    Leased addresses
 10.0.8.1             10.0.8.1         - 10.0.8.254        0
R1#
*Jul 16 08:52:39.999: DHCPD: client's VPN is .
*Jul 16 08:52:39.999: DHCPD: No option 125
*Jul 16 08:52:39.999: DHCPD: DHCPDISCOVER received from client fff6.862c.2f00.0200.00ab.11c9.627e.dce3.07b7.80 on interface FastEthernet0/0.
*Jul 16 08:52:39.999: DHCPD: Allocate an address without class information (10.0.8.0)
*Jul 16 08:52:40.003: DHCPD: Saving workspace (ID=0x7C000001)
R1#
*Jul 16 08:52:42.003: DHCPD: Reprocessing saved workspace (ID=0x7C000001)
*Jul 16 08:52:42.003: DHCPD: DHCPDISCOVER received from client fff6.862c.2f00.0200.00ab.11c9.627e.dce3.07b7.80 on interface FastEthernet0/0.
*Jul 16 08:52:42.003: DHCPD: Sending DHCPOFFER to client fff6.862c.2f00.0200.00ab.11c9.627e.dce3.07b7.80 (10.0.8.11).
*Jul 16 08:52:42.003: DHCPD: no option 125
*Jul 16 08:52:42.003: DHCPD: creating ARP entry (10.0.8.11, 4c52.6226.e0cc, vrf default).
*Jul 16 08:52:42.003: DHCPD: unicasting BOOTREPLY to client 4c52.6226.e0cc (10.0.8.11).
*Jul 16 08:52:42.007: DHCPD: client's VPN is .
*Jul 16 08:52:42.007: DHCPD: No option 125
R1#
*Jul 16 08:52:42.007: DHCPD: DHCPREQUEST received from client fff6.862c.2f00.0200.00ab.11c9.627e.dce3.07b7.80.
*Jul 16 08:52:42.007: DHCPD: Appending default domain from pool
*Jul 16 08:52:42.007: DHCPD: Using hostname 'kurumi.lab.pg1x.net.' for dynamic update (from hostname option)
*Jul 16 08:52:42.007: DHCPD: Sending DHCPACK to client fff6.862c.2f00.0200.00ab.11c9.627e.dce3.07b7.80 (10.0.8.11).
*Jul 16 08:52:42.007: DHCPD: no option 125
*Jul 16 08:52:42.007: DHCPD: ARP entry exists (10.0.8.11, 4c52.6226.e0cc).
*Jul 16 08:52:42.007: DHCPD: unicasting BOOTREPLY to client 4c52.6226.e0cc (10.0.8.11).
R1#sh ip dhcp pool

Pool SALES :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0 
 Total addresses                : 254
 Leased addresses               : 1
 Pending event                  : none
 1 subnet is currently in the pool :
 Current index        IP address range                    Leased addresses
 10.0.8.12            10.0.8.1         - 10.0.8.254        1
R1#sh ip dhc
R1#sh ip dhcp confl
R1#sh ip dhcp conflict 
IP address        Detection method   Detection time          VRF
R1#sh ip dh
R1#sh ip dhcp bin
R1#sh ip dhcp binding 
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                    Hardware address/
                    User name
10.0.8.11           fff6.862c.2f00.0200.    Jul 23 2019 08:52 PM    Automatic
                    00ab.11c9.627e.dce3.
                    07b7.80
R1#sh ip dhcp binding 
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                    Hardware address/
                    User name
10.0.8.11           fff6.862c.2f00.0200.    Jul 23 2019 08:52 PM    Automatic
                    00ab.11c9.627e.dce3.
                    07b7.80
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#acc 
R1(config)#access-list 1 per
R1(config)#access-list 1 permit 10.0.8.0 0.0.0.255
R1(config)#ip na
R1(config)#ip nat ins
R1(config)#ip nat inside sour
R1(config)#ip nat inside source li
R1(config)#ip nat inside source list 1 inter
R1(config)#ip nat inside source list 1 interface Fas
R1(config)#ip nat inside source list 1 interface FastEthernet 0/1 over
R1(config)#ip nat inside source list 1 interface FastEthernet 0/1 overload 
R1(config)#
*Jul 16 09:00:37.583: %LINEPROTO-5-UPDOWN: Line protocol on Interface NVI0, changed state to up
R1(config)#int f0/0
R1(config-if)#in nat
R1(config-if)#in nat insi
R1(config-if)#in nat insid
R1(config-if)#ip nat      
R1(config-if)#ip nat insi
R1(config-if)#ip nat inside 
R1(config-if)#int f0/1
R1(config-if)#ip nat outside
R1(config-if)#ip nat outside 
R1(config-if)#^Z
R1#
*Jul 16 09:01:27.863: %SYS-5-CONFIG_I: Configured from console by console
R1#sh ip nat sta
R1#sh ip nat statistics 
Total active translations: 0 (0 static, 0 dynamic; 0 extended)
Peak translations: 0
Outside interfaces:
  FastEthernet0/1
Inside interfaces: 
  FastEthernet0/0
Hits: 0  Misses: 0
CEF Translated packets: 0, CEF Punted packets: 0
Expired translations: 0
Dynamic mappings:
-- Inside Source
[Id: 1] access-list 1 interface FastEthernet0/1 refcount 0

Total doors: 0
Appl doors: 0
Normal doors: 0
Queued Packets: 0
R1#sh ip nat tra
R1#sh ip nat translations 
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip ro
R1(config)#ip route 0.0.0.0 0.0.0.0 10.0.8.1
R1(config)#ip nat outside                   
% Incomplete command.

R1(config)#^Z                               
R1#sh 
*Jul 16 09:02:30.363: %SYS-5-CONFIG_I: Configured from console by console
R1#sh ip nat
R1#conf t                 
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#no ip route 0.0.0.0 0.0.0.0 10.0.8.1
R1(config)#ip route 0.0.0.0 0.0.0.0 10.0.4.1   
R1(config)#^Z
R1#
*Jul 16 09:02:55.651: %SYS-5-CONFIG_I: Configured from console by console
R1#sh ip nat tra
R1#sh ip nat translations 
Pro Inside global      Inside local       Outside local      Outside global
icmp 10.0.4.254:1859   10.0.8.11:1859     8.8.8.8:1859       8.8.8.8:1859
udp 10.0.4.254:41100   10.0.8.11:41100    91.189.89.199:123  91.189.89.199:123
tcp 10.0.4.254:43028   10.0.8.11:43028    1.1.1.1:53         1.1.1.1:53
tcp 10.0.4.254:54712   10.0.8.11:54712    8.8.8.8:53         8.8.8.8:53
tcp 10.0.4.254:54714   10.0.8.11:54714    8.8.8.8:53         8.8.8.8:53
udp 10.0.4.254:59422   10.0.8.11:59422    8.8.4.4:53         8.8.4.4:53
R1#

Ubuntuで「ネームサーバー」の設定を確認する方法 | LFI

tech/network/cisco/dhcp/dhcp.txt · Last modified: 2019/07/20 08:32 by wnoguchi