Setting up DHCP server in IOS (including manual binding)

Discussion in 'Cisco' started by Torquil Corkerton, Apr 4, 2004.

  1. Hello there.

    I am currently trying to configure the DHCP server on a Cisco 2612 running
    IOS 12.2(11)T10 and the server is not behaving the way I would expect it to
    I have Googled the web and newsgroups but cannot find answers so I'm hoping
    someone here can help.

    I would like a small pool of automatically assignable addresses as well as a
    manual binding for a wireless networked laptop.

    The DHCP server is configured as follows, with identifying details changed:

    ip dhcp excluded-address 10.0.0.1 10.0.0.8
    ip dhcp excluded-address 10.0.0.10 10.0.0.128
    ip dhcp excluded-address 10.0.0.135 10.0.0.254
    !
    ip dhcp pool LONELY
    host 10.0.0.9 255.255.255.252
    hardware-address 0100.0a95.f12c.91
    default-router 10.0.0.254
    dns-server xxx.xxx.xxx.xxx
    client-name lonely
    domain-name domain.co.uk
    !
    ip dhcp pool CLIENTS
    network 10.0.0.128 255.255.255.128
    domain-name ednet.co.uk
    dns-server xxx.xxx.xxx.xxx
    default-router 10.0.0.254

    Now whenever my laptop (an airport enabled Mac Powerbook) requests an IP
    address, it doesn't get the one that's reserved for it in the LONELY pool
    but one from the CLIENTS pool.

    Better than that, every time it asks for a new one within the default lease
    time of 1 day, it gets given the next one, incrementally, in the CLIENTS
    pool, not the one it had before or even the first available one in the pool,
    even though 'sh ip dhcp bind' shows them all as free.

    Can anyone possibly tell me what I am not understanding and how I can just
    get the server to had out 10.0.0.9 to the laptop every time?

    Many thanks,


    --
    Torquil.
    --
     
    Torquil Corkerton, Apr 4, 2004
    #1
    1. Advertising

  2. "Torquil Corkerton" <torquildotcorkerton@talk21dotcom> wrote in message
    news:BC95CDF5.17DD%torquildotcorkerton@talk21dotcom...
    > I would like a small pool of automatically assignable addresses as well as

    a
    > manual binding for a wireless networked laptop.


    > hardware-address 0100.0a95.f12c.91


    =This looks like the client identifier instead of a hardware address.

    Also, try
    hardware-address 000a.9rf1.2c91 ieee802
    or
    hardware-address 000a.9rf1.2c91 ethernet

    Does the Mac provide a unique client-identifier that you can use instead?

    You may be able to say

    client-identifier 0100.0a95.f12c.91

    "debug ip dhcp server packets" could provide useful insight.

    Write back with what works so we can get the docs corrected if needed.

    > Better than that, every time it asks for a new one within the default

    lease
    > time of 1 day, it gets given the next one, incrementally, in the CLIENTS
    > pool, not the one it had before or even the first available one in the

    pool,
    > even though 'sh ip dhcp bind' shows them all as free.


    Are you using DHCP together with AAA? I know the the behavior of the
    address reuse algorithm in PPP was changed whether or not one used AAA. Are
    you using a DHCP database? (ip dhcp database)
     
    Phillip Remaker, Apr 4, 2004
    #2
    1. Advertising

  3. Phillip,

    Many thanks for your reply. I have never posted to usenet for anything so
    technical before and am impressed at such a helpful response so soon :)

    > This looks like the client identifier instead of a hardware address.
    >
    > Also, try
    > hardware-address 000a.9rf1.2c91 ieee802
    > or
    > hardware-address 000a.9rf1.2c91 ethernet


    I have tried all of the following, none of which make any difference:

    hardware-address 0100.0a95.f12c.91
    hardware-address 000a.95f1.2c91 ieee802
    hardware-address 000a.95f1.2c91 ethernet
    client-identifier 0100.0a95.f12c.91

    ....except that as I had released the IP and set to manual while I had
    changed to each line in turn in the pool, the IP allocated each time was
    129, 130, 131 but when I chose the client identifier option, it returned to
    129 again instead of 132!

    Does it make any difference which order the pools are creted in, similarly
    to the ordering of the filter lines in an ACL?

    > Does the Mac provide a unique client-identifier that you can use instead?


    It gives me the option to use a "DHCP Client ID (If required)" but I wasn't
    sure if that was the same thing or not and have not tried it.

    > "debug ip dhcp server packets" could provide useful insight.


    I set this before switching between DHCP and Manual for IP on the airport
    interface and I used 'sh ip dhcp bind' too - this is the result:

    1d03h: DHCPD: assigned IP address 10.0.0.131 to client 0100.0a95.f12c.91.
    1d03h: DHCPD: Sending DHCPOFFER to client 0100.0a95.f12c.91 (10.0.0.131).
    1d03h: DHCPD: creating ARP entry (10.0.0.131, 000a.95f1.2c91).
    1d03h: DHCPD: unicasting BOOTREPLY to client 000a.95f1.2c91 (10.0.0.131).
    1d03h: DHCPD: DHCPDISCOVER received from client 0100.0a95.f12c.91 on
    interface Ethernet0
    /0.
    1d03h: DHCPD: Sending DHCPOFFER to client 0100.0a95.f12c.91 (10.0.0.131).
    1d03h: DHCPD: creating ARP entry (10.0.0.131, 000a.95f1.2c91).
    1d03h: DHCPD: unicasting BOOTREPLY to client 000a.95f1.2c91 (10.0.0.131).
    1d03h: DHCPD: DHCPREQUEST received from client 0100.0a95.f12c.91.
    1d03h: DHCPD: Sending DHCPACK to client 0100.0a95.f12c.91 (10.0.0.131).
    1d03h: DHCPD: creating ARP entry (10.0.0.131, 000a.95f1.2c91).
    1d03h: DHCPD: unicasting BOOTREPLY to client 000a.95f1.2c91 (10.0.0.131).

    torquilADSL#sh ip dhcp bind
    Bindings from all pools not associated with VRF:
    IP address Hardware address Lease expiration Type
    10.0.0.9 0100.0a95.f12c.91 Infinite Manual
    10.0.0.131 0100.0a95.f12c.91 Apr 06 2004 12:32 AM Automatic
    torquilADSL#

    1d03h: DHCPD: DHCPRELEASE message received from client 0100.0a95.f12c.91
    (10.0.0.131).
    1d03h: DHCPD: returned 10.0.0.131 to address pool CLIENTS.

    torquilADSL#sh ip dhcp bind
    Bindings from all pools not associated with VRF:
    IP address Hardware address Lease expiration Type
    10.0.0.9 0100.0a95.f12c.91 Infinite Manual
    torquilADSL#

    1d03h: DHCPD: DHCPDISCOVER received from client 0100.0a95.f12c.91 on
    interface Ethernet0
    /0.
    1d03h: DHCPD: assigned IP address 10.0.0.132 to client 0100.0a95.f12c.91.
    1d03h: DHCPD: Sending DHCPOFFER to client 0100.0a95.f12c.91 (10.0.0.132).
    1d03h: DHCPD: creating ARP entry (10.0.0.132, 000a.95f1.2c91).
    1d03h: DHCPD: unicasting BOOTREPLY to client 000a.95f1.2c91 (10.0.0.132).
    1d03h: DHCPD: DHCPDISCOVER received from client 0100.0a95.f12c.91 on
    interface Ethernet0
    /0.
    1d03h: DHCPD: Sending DHCPOFFER to client 0100.0a95.f12c.91 (10.0.0.132).
    1d03h: DHCPD: creating ARP entry (10.0.0.132, 000a.95f1.2c91).
    1d03h: DHCPD: unicasting BOOTREPLY to client 000a.95f1.2c91 (10.0.0.132).
    1d03h: DHCPD: DHCPREQUEST received from client 0100.0a95.f12c.91.
    1d03h: DHCPD: Sending DHCPACK to client 0100.0a95.f12c.91 (10.0.0.132).
    1d03h: DHCPD: creating ARP entry (10.0.0.132, 000a.95f1.2c91).
    1d03h: DHCPD: unicasting BOOTREPLY to client 000a.95f1.2c91 (10.0.0.132).

    Just to explain why I'm trying to get this to work - at my place of work, we
    have a unix based DHCP server running which does correctly manually bind
    interfaces to the same IPs by MAC address every time, so I'd like to leave
    the interface on DHCP for home too, rather than have to change the setting
    to manual all the time, because I want to port forward to the laptop for
    things like VoIP testing and other work I do at home.

    > Are you using DHCP together with AAA? I know the the behavior of the
    > address reuse algorithm in PPP was changed whether or not one used AAA. Are
    > you using a DHCP database? (ip dhcp database)


    As it happens, yes I am using AAA for console/terminal authentication but
    not for anything to do with DHCP (I saw that AAA featured within ip dhcp but
    have not looked any closer at that).

    No, I'm not using a DHCP database. In what way would I benefit?

    I can only presume that the laptop never gets offered the 10.0.0.9 binding
    because the DHCPD presumes it cannot hand it out because it's already in
    use.

    This should be so simple but it's driving me scatty :) Many thanks for the
    thoughts so far - any more out there? :)


    --
    Torquil Corkerton
    --
     
    Torquil Corkerton, Apr 5, 2004
    #3
  4. On Sun, 04 Apr 2004 14:36:37 +0100, Torquil Corkerton wrote:

    > The DHCP server is configured as follows, with identifying details
    > changed:
    >
    > ip dhcp excluded-address 10.0.0.1 10.0.0.8 ip dhcp excluded-address
    > 10.0.0.10 10.0.0.128 ip dhcp excluded-address 10.0.0.135 10.0.0.254 !
    > ip dhcp pool LONELY
    > host 10.0.0.9 255.255.255.252
    > hardware-address 0100.0a95.f12c.91
    > default-router 10.0.0.254
    > dns-server xxx.xxx.xxx.xxx
    > client-name lonely
    > domain-name domain.co.uk
    > !
    > ip dhcp pool CLIENTS
    > network 10.0.0.128 255.255.255.128
    > domain-name ednet.co.uk
    > dns-server xxx.xxx.xxx.xxx
    > default-router 10.0.0.254
    >


    Try changing the host address in LONELY to 10.0.0.9 255.255.255.128 so the
    netmask matches the one on the interface. DHCP is probably looking at the
    LONELY pool and not using it because the netmask is incorrect.

    --
    Rgds,
    Martin
     
    Martin Gallagher, Apr 5, 2004
    #4
  5. Martin (and Phillip),

    > Try changing the host address in LONELY to 10.0.0.9 255.255.255.128 so the
    > netmask matches the one on the interface. DHCP is probably looking at the
    > LONELY pool and not using it because the netmask is incorrect.


    I tried something akin to this by making the CLIENTS pool /24, then having
    my manual binding pool within this pool. I think you're right about the pool
    as it was not including the ip address of the router/dhcpd. The trick is to
    make sure the manual bind address isn't aautomatically leased to another MAC
    by using the 'ip dhcp exclude-address' command. My modified (and working)
    config is as follows:

    ip dhcp pool CLIENTS
    network 10.0.0.0 255.255.255.0
    domain-name a.co.uk
    dns-server a.b.c.d
    default-router 10.0.0.254
    lease 0 2

    ip dhcp pool DAZED ! Desktop
    host 10.0.0.1 255.255.255.0
    client-identifier 0108.0069.0f92.ed
    client-name dazed

    ip dhcp pool LONELY ! Laptop
    host 10.0.0.2 255.255.255.0
    client-identifier 0100.0a95.f12c.91
    client-name lonely

    ip dhcp pool BITTER ! Printer
    host 10.0.0.250 255.255.255.0
    ! hardware-address 0800.0957.03f8
    ! client-identifier 0108.0009.5703.f8
    client-name bitter

    Yes, my 6 machines are called sad and lonely, bitter and twisted, dazed and
    confused ;)

    As you can see from the BITTER pool above, I am now trying to resolve a
    further problem in that I would like to manually bind an address for my
    Jetdirect enabled HP Laserjet 4MPlus. All my reading so far says that the
    DHCPD should work to serve the BOOTP request the printer makes but as soon
    as it's offered a DHCP IP lease (either auto or manually bound), the printer
    shows "80 service(009)" on its display and stops responding to anything.

    Unfortunately, whilst I read the odd newsgroup posting from someone who says
    it works for them, I can find no instructions or example configs to show
    how.

    If anyone can help me with this, they will totally make my day :)

    Many thanks,


    --
    Torquil Corkerton
    --
     
    Torquil Corkerton, Apr 5, 2004
    #5
  6. Rumor is that harware-address is used for bootp, and client-identifier for
    DHCP. So drop client-id and other stuff from BITTER and use only hardware
    address.... just the 48-bits, no extra.

    This fact is not well documented.

    Try that?

    Also, a contact inside Cisco informs me that the IOS DHCP server does not
    reuse IP addresses based on previous leases, That is the expected behavior.

    Please report back, and I will try to drive your observations back into the
    Cisco docs.
     
    Phillip Remaker, Apr 6, 2004
    #6
  7. Phillip,

    Thank you for replying again. I have emailed you direct from my other
    account because I don't think I'll get spammed by worms from you ;)

    > Rumor is that harware-address is used for bootp, and client-identifier
    > for DHCP. So drop client-id and other stuff from BITTER and use only
    > hardware address.... just the 48-bits, no extra.


    I initially just removed the other stuff from the existing BITTER pool and
    it gave me a slightly different error but an error nonetheless

    However, after I copied/pasted the pool configs to a text editor, removed
    them from the running config and then pasted them back into the router,
    it all worked as I hoped.

    Below is my current DHCP setup, slightly different from before but now
    working:

    ip dhcp excluded-address 10.0.0.0 10.0.0.100
    ip dhcp excluded-address 10.0.0.110 10.0.0.255
    !
    ip dhcp pool GLOBAL ! /24 pool
    network 10.0.0.0 255.255.255.0
    default-router 10.0.0.254
    dns-server a.b.c.d
    lease 0 1
    !
    ip dhcp pool DAZED ! Desktop (SGI320)
    host 10.0.0.1 255.255.255.0
    client-identifier 0108.0069.0f92.ed
    client-name dazed
    domain-name domain.co.uk
    !
    ip dhcp pool LONELY ! Laptop (Aluminium G4 Powerbook)
    host 10.0.0.2 255.255.255.0
    client-identifier 0100.0a95.f12c.91
    client-name lonely
    domain-name domain.co.uk
    !
    ip dhcp pool BITTER ! Printer
    host 10.0.0.250 255.255.255.0
    hardware-address 0800.0957.03f8

    > Also, a contact inside Cisco informs me that the IOS DHCP server does
    > not reuse IP addresses based on previous leases, That is the expected
    > behavior.


    Now I have created manual bindings for my machines, this is no longer an
    issue for me and I'm not fussed about what address in the pool any guest
    user gets.

    > This fact is not well documented.
    >
    > Please report back, and I will try to drive your observations back into
    > the Cisco docs.


    You have been most helpful, Phillip; thank you. I think the problem I have
    had most with all the Cisco documentation I have read is that it explains
    all my options but it's not clear when I should use which option and the
    examples are not exactly real life :)

    As you suggested, it would be handy if the DHCP documentation gave more
    info about BOOTP. This is the document I referred to most:

    http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120
    t/120t1/easyip2.htm

    At least this thread and your paternal advice are now available to this
    newsgroup, should anyone else have a similar problem ;)

    Kind Regards,


    --
    torquil corkerton
     
    Torquil Corkerton, Apr 6, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ed Kideys, Tech-Train
    Replies:
    3
    Views:
    4,652
    Wence Van der Meersch
    Apr 30, 2004
  2. colin c.
    Replies:
    9
    Views:
    2,883
    Martin Gallagher
    Aug 19, 2006
  3. sonicgravy
    Replies:
    0
    Views:
    1,470
    sonicgravy
    Nov 13, 2006
  4. Greg H.
    Replies:
    2
    Views:
    1,568
    Greg H.
    Oct 26, 2006
  5. Bob Simon

    show ip dhcp binding

    Bob Simon, Dec 20, 2006, in forum: Cisco
    Replies:
    1
    Views:
    5,786
    Aaron Leonard
    Dec 20, 2006
Loading...

Share This Page