DHCP Server – Setting Up Two Routers for DHCP

ciscodhcppacket-tracerrouting

Here is my topology:

topology picture

I'm trying to get a DHCP IP address for a Windows XP client, but when I do the ipconfig /renew command, it said, can not use the rpc server and failed to get an ip address from dhcp server.

Please check my topology and configurations:

R

 Router#sh run
    Building configuration...

    Current configuration : 1091 bytes
    !
    ! Last configuration change at 14:17:26 UTC Fri Oct 28 2016
    !
    version 15.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname Router
    !
    boot-start-marker
    boot-end-marker
    !
    aqm-register-fnf
    !
    !
    no aaa new-model
    mmi polling-interval 60
    no mmi auto-configure
    no mmi pvc
    mmi snmp-timeout 180
    !
    !
    !
    !
    !
    !


    !
    ip dhcp excluded-address 1.1.1.254
    ip dhcp excluded-address 1.1.1.1 1.1.1.10
    !
    ip dhcp pool A
    network 1.1.1.0 255.255.255.0
    default-router 1.1.1.254
    dns-server 168.126.63.1
    lease 0 8
    !
    !
    !
    ip cef
    no ipv6 cef
    !
    multilink bundle-name authenticated
    !
    !
    !
    !
    !
    !
    !
    !
    !
    redundancy

    !
    interface Ethernet0/0
    ip address 1.1.2.2 255.255.255.0
    !
    interface Ethernet0/1
     no ip address
    shutdown
    !
    interface Ethernet0/2
    no ip address
    shutdown
    !
    interface Ethernet0/3
    no ip address
    shutdown
    !
    ip forward-protocol nd
    !
    !
    no ip http server
    no ip http secure-server

    control-plane

    line con 0
    logging synchronous
    line aux 0
    line vty 0 4
     login
    transport input none
    !
    !
    end

R1

    Router#sh run
Building configuration...

Current configuration : 2327 bytes
!
! Last configuration change at 12:59:47 UTC Fri Oct 28 2016
!
version 15.4
service config
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
aqm-register-fnf
!
!
no aaa new-model
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!
!
!
!
!
!


!
!
!
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 1.1.1.254 255.255.255.0
 ip helper-address 1.1.2.2
!
interface Ethernet0/1
 ip address 1.1.2.1 255.255.255.0
!
interface Ethernet0/2
 no ip address
 shutdown
!
interface Ethernet0/3
 no ip address
 shutdown
!
interface Ethernet1/0
 no ip address
 shutdown
!
interface Ethernet1/1
 no ip address
 shutdown
!
interface Ethernet1/2
 no ip address
 shutdown
!
interface Ethernet1/3
 no ip address
 shutdown
!
interface Ethernet2/0
 no ip address
 shutdown
!
interface Ethernet2/1
 no ip address
 shutdown
!
interface Ethernet2/2
 no ip address
 shutdown
!
interface Ethernet2/3
 no ip address
 shutdown
!
interface Ethernet3/0
 no ip address
 shutdown
!
interface Ethernet3/1
 no ip address
 shutdown
!
interface Ethernet3/2
 no ip address
 shutdown
!
interface Ethernet3/3
 no ip address
 shutdown
!
interface Ethernet4/0
 no ip address
 shutdown
!
interface Ethernet4/1
 no ip address
 shutdown
!
interface Ethernet4/2
 no ip address
 shutdown
!
interface Ethernet4/3
 no ip address
 shutdown
!
interface Ethernet5/0
 no ip address
 shutdown
!
interface Ethernet5/1
 no ip address
 shutdown
!
interface Ethernet5/2
 no ip address
 shutdown
!
interface Ethernet5/3
 no ip address
 shutdown
!
interface Ethernet6/0
 no ip address
 shutdown
!
interface Ethernet6/1
 no ip address
 shutdown
!
interface Ethernet6/2
 no ip address
 shutdown
!
interface Ethernet6/3
 no ip address
 shutdown
!
interface Ethernet7/0
 no ip address
 shutdown
!
interface Ethernet7/1
 no ip address
 shutdown
!
interface Ethernet7/2
 no ip address
 shutdown
!
interface Ethernet7/3
 no ip address
 shutdown
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login
 transport input none
!
!
end

Another question:

I put the DHCP server's default-router address as 1.1.1.254, but when do we need this default router address and dns-server address?

Best Answer

From what I can see in your configuration of R, it doesn't have a route to the 1.1.1.0/24 network.

You really shouldn't use the default-router command, but if you do, it needs to be a network that R knows about. That would be the directly attached network, and the default-router should be 1.1.2.1.

A better option would be to either use a static route to the 1.1.1.0/24 network:

ip route 1.1.1.0 255.255.255.0 1.1.2.1

or put in a default route:

ip route 0.0.0.0 0.0.0.0 1.1.2.1

or run a routing protocol between the two routers.