Cisco DHCP on Vlans

Aus xinux.net
Zur Navigation springen Zur Suche springen

Anzeige Vlan Interfaces mit IP

  • switch-gelb#show running-config
interface Vlan1
 ip address 192.168.240.154 255.255.248.0
!         
interface Vlan10
 ip address 192.168.10.1 255.255.255.0
!         
interface Vlan20
 ip address 192.168.20.1 255.255.255.0
!         
interface Vlan30
 ip address 192.168.30.1 255.255.255.0
!         

DHCP Pools anlegen

  • switch-gelb#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Adressen rausnehmen

  • switch-gelb(config)#ip dhcp excluded-address 192.168.20.1 192.168.20.50
  • switch-gelb(config)#ip dhcp excluded-address 192.168.30.1 192.168.30.50
  • switch-gelb(config)#ip dhcp excluded-address 192.168.40.1 192.168.40.50

DHCP konfiguren

  • switch-gelb(config)#ip dhcp pool dpool10
  • switch-gelb(dhcp-config)#network 192.168.10.0 255.255.255.0
  • switch-gelb(dhcp-config)#default-router 192.168.10.1
  • switch-gelb(dhcp-config)#dns-server 192.168.240.200
  • switch-gelb(dhcp-config)#domain-name office.xinux.org
  • switch-gelb(dhcp-config)#ip dhcp pool dpool20
  • switch-gelb(dhcp-config)#network 192.168.20.0 255.255.255.0
  • switch-gelb(dhcp-config)#default-router 192.168.20.1
  • switch-gelb(dhcp-config)#dns-server 192.168.240.200
  • switch-gelb(dhcp-config)#domain-name work.xinux.org
  • switch-gelb(dhcp-config)#ip dhcp pool dpool30
  • switch-gelb(dhcp-config)#network 192.168.30.0 255.255.255.0
  • switch-gelb(dhcp-config)#default-router 192.168.30.1
  • switch-gelb(dhcp-config)#dns-server 192.168.240.200
  • switch-gelb(dhcp-config)#domain-name labor.xinux.org

Dhcp in der Running Konfig

  • switch-gelb#show running-config
...
ip dhcp pool dpool10
   network 192.168.10.0 255.255.255.0
   default-router 192.168.10.1 
   domain-name office.xinux.org
   dns-server 192.168.240.200 
!
ip dhcp pool dpool20
   network 192.168.20.0 255.255.255.0
   default-router 192.168.20.1 
   dns-server 192.168.240.200 
   domain-name work.xinux.org
!
ip dhcp pool dpool30
   network 192.168.30.0 255.255.255.0
   default-router 192.168.30.1 
   dns-server 192.168.240.200 
   domain-name labor.xinux.org
!
...

Dhcp Pools anzeigen

  • switch-gelb#show ip dhcp pool

Pool dpool10 :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0 
 Total addresses                : 254
 Leased addresses               : 0
 Excluded addresses             : 0
 Pending event                  : none
 1 subnet is currently in the pool :
 Current index        IP address range                    Leased/Excluded/Total
 192.168.10.1         192.168.10.1     - 192.168.10.254    0     / 0     / 254  

Pool dpool20 :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0 
 Total addresses                : 254
 Leased addresses               : 2
 Excluded addresses             : 50
 Pending event                  : none
 1 subnet is currently in the pool :
 Current index        IP address range                    Leased/Excluded/Total
 192.168.20.53        192.168.20.1     - 192.168.20.254    2     / 50    / 254  

Pool dpool30 :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0 
 Total addresses                : 254
 Leased addresses               : 2
 Excluded addresses             : 50
 Pending event                  : none
 1 subnet is currently in the pool :
 Current index        IP address range                    Leased/Excluded/Total
 192.168.30.53        192.168.30.1     - 192.168.30.254    2     / 50    / 254  

Leases anzeigen

  • switch-gelb#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address          Client-ID/	 	    Lease expiration        Type
		    Hardware address/
		    User name
192.168.20.51       0160.eb69.962d.a5       Feb 02 2016 11:56 AM    Automatic
192.168.20.52       0001.2e34.b06a          Feb 02 2016 11:54 AM    Automatic

Server Statistiken

  • switch-gelb#show ip dhcp server statistics
Memory usage         19247
Address pools        3
Database agents      0
Automatic bindings   2
Manual bindings      0
Expired bindings     0
Malformed messages   0
Secure arp entries   0
Renew messages       1

Message              Received
BOOTREQUEST          0
DHCPDISCOVER         6
DHCPREQUEST          8
DHCPDECLINE          0
DHCPRELEASE          0
DHCPINFORM           0

Message              Sent
BOOTREPLY            0
DHCPOFFER            5
DHCPACK              5
DHCPNAK              2

Hardwareadresse reservieren(überarbeiten)

  • switch-gelb#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
  • switch-gelb(config)#ip dhcp pool dpool10
  • switch-gelb(dhcp-config)#address 192.168.10.76 hardware-address 60EB69962DA5