cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8830
Views
2
Helpful
16
Replies

How to assign multiple static IP addresses for one DHCP pool?

atut
Level 1
Level 1

I want to assign many static IP addresses to many clients that connect through Access Points.

For testing:

1) I add this command to configuration: address 10.10.24.58 hardware-address f027.6579.9819

2) The client's phone still leasing 10.10.24.75 (random IP from DHCP)

3) I forget the wifi connection from client's phone

4) I run command clear ip dhcp binding 10.10.24.75

5) I reconnect client's phone to wifi, but the phone cannot get the assigned IP 10.10.24.58, it still gets random IP from DHCP (other than 10.10.24.75)

 

What is wrong and how to resolve this?

 

16 Replies 16

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

you want your config to look like this:

 

!
ip dhcp pool main
  network 10.10.24.0 255.255.255.0
  dns-server 8.8.8.8
!
ip dhcp pool main_host01
  host 10.10.24.58
  client identifier 01f0.2765.7998.19
  hardware-address f027.6579.9819
  client-name HOST01
!

The key here is that you are creating a sub pool of the main DHCP pool 'main' and detailing the client in that secion.

Take a look at this:

https://www.cisco.com/c/en/us/td/docs/ios/12_2/ip/configuration/guide/fipr_c/1cfdhcp.html#wp1001108

 

cheers,

Seb.

Thanks @Seb Rupik

 

I have this configuration:

 

!
ip dhcp pool WIFI_ASTINET
 network 10.10.24.0 255.255.255.0
 dns-server 118.98.44.100 202.134.0.155
 default-router 10.10.24.254
 option 43 hex f104.0a0a.0b78
 option 60 ascii Cisco AP c1700
   address 10.10.24.58 hardware-address f027.6579.9819
!
interface Vlan24
 description *VLAN Wireless lt2 SVI*
 ip address 10.10.24.254 255.255.255.0
!

 

 

1) From the configuration above, what the sub pool will look like that I am going to create? Please advise?

2) You notice this command:

address 10.10.24.58 hardware-address f027.6579.9819

 The above command I referred from https : // networkengineering stackexchange com /questions/32600/assign-an-ip-to-a-mac-address-to-dhcp-pool

Someone mentioned:

 
There is NO host keyword; erase that from your brain. In the summary steps above, you do steps 1 to 4 to create a DHCP pool for the network. You can skip step 5 and just do step 6 (forget about the [hardware-number]) to reserve the IP address in the pool for the host: address 192.168.17.137 hardware-address 0100.71cc.02XX

So I don't know which command is true:

1) address <ip address> hardware-address <mac-address>; or

2) create sub pool

Having just configured this on a switch running IOS 15.2(5)E2 I can confirm that your original configuration does work.

 

When your device gets the wrong lease, what does the output of

sh ip dhcp binding

...look like?

 

cheers,

Seb.

@Seb Rupik

It looks like this

PHGDSSW01#sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address      Client-ID/              Lease expiration        Type       State      Interface
                Hardware address/
                User name
10.10.24.27     0118.8b9d.bc6f.a0       Aug 25 2017 09:27 PM    Automatic  Active     Vlan24
10.10.24.29     01e8.6549.d328.a4       Aug 25 2017 11:55 PM    Automatic  Active     Vlan24
10.10.24.33     01e8.6549.d328.70       Aug 25 2017 08:56 PM    Automatic  Active     Vlan24
10.10.24.34     0118.8b9d.bc70.44       Aug 26 2017 02:13 AM    Automatic  Active     Vlan24
10.10.24.35     0180.e01d.ac4e.b4       Aug 25 2017 09:41 PM    Automatic  Active     Vlan24
10.10.24.45     01ec.1f72.acea.bf       Aug 26 2017 08:16 AM    Automatic  Active     Vlan24

So can you please advise which command is actually true?

1) address <ip address> hardware-address <mac-address>; or

2) create sub pool

 

By following you to create sub pool, how will be my sub pool looks like if I have main DHCP as follow:

!
ip dhcp pool WIFI_ASTINET
 network 10.10.24.0 255.255.255.0
 dns-server 118.98.44.100 202.134.0.155
 default-router 10.10.24.254
 option 43 hex f104.0a0a.0b78
 option 60 ascii Cisco AP c1700
   address 10.10.24.58 hardware-address f027.6579.9819
!
interface Vlan24
 description *VLAN Wireless lt2 SVI*
 ip address 10.10.24.254 255.255.255.0
!

So if I want to assign 20 static DHCP binding, I have to create 20 sub pools?

Thanks.

Hi there,

Perhaps in your case try using the client-id instead of the hardware address in the reservation, eg:

 

!
ip dhcp pool WIFI_ASTINET
  address 10.10.24.58 client-id 01f0.2765.7998.19
!

Just take client-id details from the output of 'sh ip dhcp binding', ensuring the '01' prefix is there.

 

I have tested both methods using IOS15.2(5)E5 and can confirm both work. Try the sub pool method, although more verbose it may work for you.

What version of IOS and device are you using?

 

cheers,

Seb.

@Seb Rupikfrom show version, I am not sure which version am I using?

 

PHGDSSW01#show version
Cisco IOS Software, IOS-XE Software, Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 03.07.01E RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2015 by Cisco Systems, Inc.
Compiled Tue 28-Apr-15 00:28 by prod_rel_team



Cisco IOS-XE software, Copyright (c) 2005-2015 by cisco Systems, Inc.
All rights reserved.  Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0.  The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY.  You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0.
(http://www.gnu.org/licenses/gpl-2.0.html) For more details, see the
documentation or "License Notice" file accompanying the IOS-XE software,
or the applicable URL provided on the flyer accompanying the IOS-XE
software.



ROM: IOS-XE ROMMON
BOOTLDR: CAT3K_CAA Boot Loader (CAT3K_CAA-HBOOT-M) Version 1.18, RELEASE SOFTWARE (P)

PHGDSSW01 uptime is 47 weeks, 5 days, 21 hours, 48 minutes
Uptime for this control processor is 47 weeks, 5 days, 21 hours, 52 minutes
System returned to ROM by SSO Switchover
System restarted at 17:31:43 WIB Sat Sep 24 2016
System image file is "flash:packages.conf"
Last reload reason: Power Failure



This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.

License Level: Ipbase
License Type: Permanent
Next reload license Level: Ipbase

cisco WS-C3850-24T (MIPS) processor with 4194304K bytes of physical memory.
Processor board ID FOC1929U0HC
28 Virtual Ethernet interfaces
56 Gigabit Ethernet interfaces
8 Ten Gigabit Ethernet interfaces
2048K bytes of non-volatile configuration memory.
4194304K bytes of physical memory.
250456K bytes of Crash Files at crashinfo:.
250456K bytes of Crash Files at crashinfo-1:.
1609272K bytes of Flash at flash:.
1609272K bytes of Flash at flash-1:.
0K bytes of Dummy USB Flash at usbflash0:.
0K bytes of Dummy USB Flash at usbflash0-1:.
0K bytes of  at webui:.

Base Ethernet MAC Address          : 80:e8:6f:68:f2:80
Motherboard Assembly Number        : 73-16297-04
Motherboard Serial Number          : FOC1928AWYX
Model Revision Number              : U0
Motherboard Revision Number        : A0
Model Number                       : WS-C3850-24T
System Serial Number               : FOC1929U0HC


Switch Ports Model              SW Version        SW Image              Mode
------ ----- -----              ----------        ----------            ----
     1 32    WS-C3850-24T       03.07.01E         cat3k_caa-universalk9 INSTALL
*    2 32    WS-C3850-24T       03.07.01E         cat3k_caa-universalk9 INSTALL


Switch 01
---------
Switch uptime                      : 33 weeks, 4 days, 6 hours, 59 minutes
Base Ethernet MAC Address          : 80:e8:6f:62:a9:80
Motherboard Assembly Number        : 73-16297-04
Motherboard Serial Number          : FOC1928AWWE
Model Revision Number              : U0
Motherboard Revision Number        : A0
Model Number                       : WS-C3850-24T
System Serial Number               : FOC1929U0KB

Configuration register is 0x102

Both methods that you tried, is that 1) client-id instead of hardware-address; and 2) create many sub pools?

 

I don't like create many sub pools method, if I use client-id instead of hardware-address, can I create multiple bindings in one pool? For example it looks like this:

!
ip dhcp pool WIFI_ASTINET
 network 10.10.24.0 255.255.255.0
 dns-server 118.98.44.100 202.134.0.155
 default-router 10.10.24.254
 option 43 hex f104.0a0a.0b78
 option 60 ascii Cisco AP c1700
   address 10.10.24.58 client-id 01f0.2765.7998.19
   address 10.10.24.60 client-id 01xx.xxxx.xxxx.xx
   address 10.10.24.80 client-id 01xx.xxxx.xxxx.xx
   address 10.10.24.88 client-id 01xx.xxxx.xxxx.xx
   address 10.10.24.100 client-id 01xx.xxxx.xxxx.xx
!

Thanks.

 

I've tried all three methods:

  • sub-pool
  • Main DHCP pool, address client-id
  • Main DHCP pool, address hardware-address

...and all have worked, and yes you can specifiy multiple manual addresses in main pool. The config you have provided looks good.

 

cheers,

Seb.

@Seb Rupikyou tried three methods?

 

Main DHCP pool, address hardware-address --> are you sure this method works for you? then why it does not work with me?

 

Hi Atut,

 

Have you got any solution?

I have same issue. if you have the solution please update for me.

 

Thanks & regards

Rajinder

Hello Rajindelhi,

Greetings,

I have understood that you have the same problem, that you have a dhcp server (can be the network device itself) and you would like to bind a specific IP address to a specific mac address so that every time such a device connect to the network, it will get the same IP address from the dhcp pool, do i understand your problem correctly ?

 

I wait your reply so that I can help you! 

 

Please rate my post if you find it helpful!

Thanks in Advance!

Andrew Khalil

 

Hi Andrew,

 

Yes. you are right.

 

I solved this problem with help of Sub_DHCP pool but for this I have to create sub_DHCP pool for every MAC ID.

Other options not work for me. I don't know why?

I got configuration from below link.

 

https://community.cisco.com/t5/switching/how-to-assign-multiple-static-ip-addresses-for-one-dhcp-pool/td-p/3175152

 

Regards

Rajinder

 

Hello Rajindelhi,

Greetings,

Sorry for my late response, only I was trying to reply but the website was considering my reply as a spam! I don't know why! Anyway, here we go! 

The problem that you face is most probably because all the configuration from the begining of the discussion is missing the command that relate the sub dhcp pool to the main dhcp pool, without this command, the switch will consider it 2 separate pools, which means that when you will apply the sub dhcp pool then type the command: #show ip dhcp binding, you will find the mac is binded to the desired ip add. but anyway when you connect this device to the network it will get new ip! and then if you will type again #show ip dhcp binding, you will find 1 mac address binded to 2 different ip add.,one of them static by the means of the sub dhcp pool and the another 1 is dynamically! 

 

Andrew Khalil

Hello again Rajindelhi,

Here is the rest on my previous reply, I will an example to show you how we can relate the sub pool to the main one, let's consider that we configure the following main dhcp pool:

#ip dhcp pool for_vlan_10

#network 10.1.10.0 255.255.255.0

#default-router 10.1.10.1 "where the ip 10.1.10.1 is the IP address of interface vlan 10 (SVI)"

#dns-server 8.8.8.8

#exit

To bind the Mac add. xxxx.xxxx.xxxx to the ip add. 10.1.10.100, so we create the following sub dhcp pool:

#ip dhcp pool Static_Bind_10.1.10.100

#host 10.1.10.100 255.255.255.0
#client-identifier 01xx.xxxx.xxxx.xx "As appearing in the dhcp binding table"
#default-router 10.1.10.1 "this is the command that relate the sub dhcp pool to the main one!"
#dns-server 8.8.8.8

#exit

Now, it's done! & every time will connect the PC with xxxx.xxxx.xxxx Mac add. it will get the IP add 10.1.10.100 Try it, it should work successfully! Please, mark my post as a solution if it solved your problem, also don't forget to rate my reply if it's helpful ))))

Thanks in advance, Bst Rgds!

Andrew Khalil 

Hello Rajindelhi,

How is the situation?

I will be happy to help in solving your issue! 

Bst Rgds,

Andrew Khalil

Review Cisco Networking for a $25 gift card