2

I'm trying to get DHCP to work between these two Devices. Any tip's would be wonderful!

Switch Config

Switch#show run      
Building configuration...

Current configuration : 1596 bytes
!
! Last configuration change at 00:45:35 UTC Mon Mar 1 1993
!
version 12.2
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Switch
!
boot-start-marker
boot-end-marker
!
!
username nick secret 5 
no aaa new-model
system mtu routing 1500
!
!
ip dhcp-server 10.1.1.1
!
!         
!
!         
!
!         
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
!         
!
!         
!
!         
interface GigabitEthernet0/1
!         
interface GigabitEthernet0/2
!         
interface GigabitEthernet0/3
!         
interface GigabitEthernet0/4
!         
interface GigabitEthernet0/5
!         
interface GigabitEthernet0/6
!         
interface GigabitEthernet0/7
!         
interface GigabitEthernet0/8
!         
interface GigabitEthernet0/9
!         
interface GigabitEthernet0/10
!         
interface GigabitEthernet0/11
!         
interface GigabitEthernet0/12
!         
interface GigabitEthernet0/13
!         
interface GigabitEthernet0/14
!         
interface GigabitEthernet0/15
!         
interface GigabitEthernet0/16
!         
interface GigabitEthernet0/17
!         
interface GigabitEthernet0/18
!         
interface GigabitEthernet0/19
!         
interface GigabitEthernet0/20
!         
interface GigabitEthernet0/21
!         
interface GigabitEthernet0/22
!         
interface GigabitEthernet0/23
!         
interface GigabitEthernet0/24
!         
interface GigabitEthernet0/25
!         
interface GigabitEthernet0/26
!         
interface GigabitEthernet0/27
!         
interface GigabitEthernet0/28
!         
interface Vlan1
 ip address 10.1.1.100 255.255.255.0
 ip helper-address 10.1.1.1
!         
ip default-gateway 10.1.1.1
ip http server
ip http secure-server
!         
!
logging esm config
!
!         
line con 0
line vty 5 15
!
end     

Router Config

cisco2821#show run
Building configuration...


Current configuration : 1749 bytes
!
! Last configuration change at 18:05:40 AEST Sat May 19 2018 by nick
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname cisco2821
!
boot-start-marker
boot-end-marker
!
!
! card type command needed for slot/vwic-slot 0/1
enable secret 5 
!
no aaa new-model
!
clock timezone AEST 10 0
no network-clock-participate wic 2 
!
dot11 syslog
ip source-route
!         
!         
ip cef    
!         
ip dhcp excluded-address 10.1.1.1
ip dhcp excluded-address 10.1.1.1 10.1.1.255
ip dhcp excluded-address 10.1.1.1 10.1.1.100
ip dhcp excluded-address 10.1.1.2
!         
ip dhcp pool VLAN50
 network 10.1.1.0 255.255.255.0
 default-router 10.1.1.1 
 dns-server 4.4.4.4 8.8.8.8 
 lease 3 12 15
!         
ip dhcp pool lab
 network 10.1.2.0 255.255.255.0
 default-router 10.1.1.1 
 dns-server 4.4.4.4 8.8.8.8 
 lease 3 12 15
!         
!         
ip domain name nick.com
no ipv6 cef
!         
multilink bundle-name authenticated
!         
!         
!         
!         
!         
!         
!         
!         
!         
!         
!         
voice-card 0
!         
crypto pki token default removal timeout 0
!         
!         
!         
!         
license udi pid CISCO2821 sn FH
username nick password 0 
!         
redundancy
!         
!         
controller E1 0/2/0
!         
ip ssh version 2
!         
!         
!         
!         
!         
!         
!         
!         
interface GigabitEthernet0/0
 ip address dhcp
 ip helper-address 192.168.20.1
 duplex auto
 speed auto
!         
interface GigabitEthernet0/1
 ip address 10.1.1.1 255.255.255.0
 duplex auto
 speed auto
!         
router ospf 1
 router-id 10.1.1.1
 network 10.1.1.1 0.0.0.0 area 0
!         
ip forward-protocol nd
no ip http server
no ip http secure-server
!         
!         
!         
!         
!         
!         
!         
!         
!         
control-plane
!         
!         
!         
!         
mgcp profile default
!         
!         
!         
!         
!         
gatekeeper
 shutdown 
!         
!         
!         
line con 0
line aux 0
line vty 0 4
 login local
 transport input all
!         
scheduler allocate 20000 1000
ntp server 192.168.20.1
end   

cisco2821#show ip dhcp pool

Pool VLAN50 :
 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
 0.0.0.0              10.1.1.1         - 10.1.1.254        0

Pool lab :
 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.1.2.1             10.1.2.1         - 10.1.2.254        0
1
  • 1
    Please add some more details on what problem you're facing. Error messages and/or debugging output would be useful too.
    – Teun Vink
    May 19 '18 at 12:33
4

You have several problems:

  • You excluded every address in the VLAN50 DHCP pool:

    ip dhcp excluded-address 10.1.1.1 10.1.1.255
    

    The command is:

    ip dhcp excluded-address {low-address [high-address]}
    

    You only want to exclude addresses that are statically defined, and, as far as I can tell, that would only be the switch address of 10.1.1.100. You do not need to exclude the router interface address, 10.1.1.1, because the router will do that for you. So, the only exclusion that you should have is:

    ip dhcp excluded-address 10.1.1.100
    
  • The gateway for a network must be an address in the network. You have this:

    ip dhcp pool lab
     network 10.1.2.0 255.255.255.0
     default-router 10.1.1.1 
     dns-server 4.4.4.4 8.8.8.8 
     lease 3 12 15
    !
    

    but the gateway (default-router) is in a different network, so the hosts would need a gateway to get to the gateway, and it doesn't work that way.

    You also have not given us the configuration of a device that has the 10.1.2.0/24 network, so I'm not sure why you have that that.

  • The helper-address command on an interface is using DHCP for itself doesn't make sense or even work. You put a helper address on a router interface for a network that has no DHCP server on the network, and it points to a DHCP server with a scope for that network that the router knows how to reach. The router itself is using DHCP on your interface so there must be a DHCP server on the network to which the router is connected, or there is a helper address on a different router on that same network:

    interface GigabitEthernet0/0
     ip address dhcp
     ip helper-address 192.168.20.1   ! This is incorrect bcause the network is served by another device, not this router
     duplex auto
     speed auto
    !
    
  • Your OSPF configuration doesn't make sense with what you have. You only have one interface participating in OSPF, but routers route between networks, and the router already knows about the 10.1.1.0/24 network. OSPF is used to share routes between routers, and I don't see where you have another router on that network. The router will automatically route between any directly connected networks. More likely, you need a statically defined default route:

    ip route 0.0.0.0 0.0.0.0 dhcp
    
  • You have named your DHCP pool VLAN50, but the VLAN it is serving is VLAN 1, so it could be very misleading and cause confusion at a later date.

  • On the switch, you should not have the ip dhcp-server 10.1.1.1 command. Use:

    no ip dhcp-server 10.1.1.1
    
  • Also, on the switch remove the ip helper-address 10.1.1.1 command from interface Vlan1:

    no ip helper-address 10.1.1.1
    

    That command isn't actually doing anything because the DHCP server for that network is on that network. The command could be used for a DHCP server on a different network, but it is better to place it on the router interface.

1
  • Thank you so much. I'm learning how all of this works at the moment so it was all bound to be riddled with silly configuration options. Your lengthy reply has been most welcome. Thanks!
    – Nicholas
    May 19 '18 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.