2

Basically, what I need is super similar to the unanswered cisco forum question below: https://supportforums.cisco.com/message/3139749#3139749

I have a Cisco 850 Series router. I have configured a DHCP pool for the 10.0.0.0/24 network. I have excluded 10.0.0.1 - 10.0.0.99 from the DHCP pool. I want to add a static DHCP pool for stuff and I want DHCP to statically assign them the addresses of my choice below 100. Actually, I don't care what addresses I statically assign. They can be anything in the pool for all I care, I just want it to work.

Why are you doing this? Just statically assign the IPs on the devices!

I don't want to do this because I have some laptop users. They could obviously only use that static IP here. This isn't a problem if they could be bothered to change any location setting or something. They can't. So it HAS to be DHCP. It also has to be static IPs because I need to forward ports to them. I know, I know, this is weird but it's an apartment LAN/WLAN so this isn't exactly a typical use case.

Relevant sections of config below:

ip dhcp excluded-address 10.0.0.1 10.0.0.99
!
ip dhcp pool Internal-net
   import all
   network 10.0.0.0 255.255.255.0
   default-router 10.0.0.1 
   domain-name 1770.local
   lease 7
!
ip dhcp pool static-pool
   import all
   origin file flash://staticmap
   default-router 10.0.0.1 
   domain-name 1770.local

Contents of staticmap:

*time* Aug 5 2010 09:00 AM
*version* 2
!IP address Type Hardware address Lease expiration
10.0.0.100/24 1  001f.5b3e.d50a   Infinite
*end*

You can see here I was trying addresses outside the excluded-address range to see if that would make any difference.

My testing machine's MAC:

mainframe:~ brad$ ifconfig en1
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 00:1f:5b:3e:d5:0a 

What shows up in the DHCP binding table:

basestar#show ip dhcp binding 
Bindings from all pools not associated with VRF:
IP address          Client-ID/          Lease expiration        Type
            Hardware address/
            User name
10.0.0.112          0100.1f5b.3ed5.0a       Aug 12 2010 10:06 AM    Automatic

What's up with the funny looking MAC in the DHCP binding table??

Is what I'm trying to accomplish basically impossible?

Am I going about this the wrong way? All I want to to be able to port forward some ports to specific devices. The way I would do this with a consumer router is to do what I'm trying to do here; assign static DHCP to those devices then configure PAT for ports on those addresses.

Brad
  • 295
  • 1
  • 2
  • 9
  • Apparently the "funny looking MAC" in that DHCP binding table is the DHCP client-id. – Brad Aug 05 '10 at 14:50

2 Answers2

2

I followed the instructions here instead: http://paulsuela.wordpress.com/2009/04/28/cisco-dhcp-static-ip-assignment/

Instead of using the static mapping file, create separate DHCP pools for each static assignment. Doesn't scale well as the mapping file, but it's a small network so that's fine.

The key is to make sure you have the correct client-id, which is not the same as the MAC address but COULD be similar if the client doesn't send a custom configured client-id.

Brad
  • 295
  • 1
  • 2
  • 9
2

You almost got it working ,

In your staticmap file just change the Type of '1' to : 'id' ,

static file :

*time* Sep 3 2012 11:10 AM
*version* 1
!IP address    Type    Hardware address     Lease expiration
10.0.0.8 /8     id       0100.301b.473d.d8       Infinite
10.0.0.28 /8    id       0184.8f69.b77b.dc       Infinite
*end*

And the config snippet :

!
ip dhcp pool StaticBindings
 origin file flash:static-bindings
 default-router 10.0.0.1
 dns-server 10.0.0.1
 netbios-name-server 10.0.0.1
! 

Works like a charm. ( Cisco 3945E )

Dave M
  • 4,494
  • 21
  • 30
  • 30