4

The idea is that I want to have a static IP for the MAC computer always assign me the IP . please help , as would the commands ?

I have a cisco 3650 switch core where I configured the DHCP and VLAN former systems administrator assigned an IP to MAC address as follows :

  • ip dhcp pool NAME
  • host 192.168.17.137 255.255.255.0
  • client-identifier 0100.71cc.02XX.XX
  • client-name NAME

but I do not know how to do it for a VLAN IP 17 as mentioned always assign me a static IP .

1
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Aug 14, 2017 at 18:42

1 Answer 1

3

On a Cisco IOS DHCP server, it is pretty simple. In the DHCP pool configuration, use the address command to assign an IP address to a MAC address:

address <ip-address> hardware-address <mac-address>

Preassigning IP Addresses and Associating Them to a Client:

Preassigning IP Addresses and Associating Them to a Client

Perform this task to preassign an IP address and associate it to a client identified by a client ID or MAC address.

For port-based address assignment, you must perform the task in the Automatically Generating a Subscriber Identifier for a DHCP Message Received on a Port task to associate the client ID with the subscriber ID. The subscriber ID value is based on the short name of the port to which the directly connected device is attached.

Configure a normal DHCP pool by supplying any DHCP options and lease time. Preassigned addresses are automatically excluded from normal dynamic IP address assignment. Preassigned addresses cannot be used in host pools, but there can be multiple preassigned addresses per DHCP address pool.

Note

Only one IP address can be assigned per port.

Preassigned addresses (also called reserved addresses) cannot be cleared by using the clear ip dhcp binding command.

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. ip dhcp pool name
  4. network network-number [mask | / prefix-length]
  5. address ip-address client-id string [ascii]
  6. address ip-address hardware-address mac-address [hardware-number]
  7. end
  8. show ip dhcp pool [name]
  9. show ip dhcp binding

Edit:

Based on your comments:

ip dhcp pool Test-Pool
network 192.168.17.0/24
address 192.168.17.137 hardware-address 0100.71cc.02XX
13
  • For example I have to do the following : 1.conf t 2. ip dhcp pool DCANTOS 3. host 192.168.17.137 255.255.255.0 4.client -identifier 0100.71cc.02XX.XX 5. client -name DCANTOS There not know what else follows?
    – dcantos
    Jun 27, 2016 at 20:24
  • There is no host keyword. Use the address keyword. You really only need address <ip-address> hardware-address <mac-address> in the DHCP pool after you have defined the network address.
    – Ron Maupin
    Jun 27, 2016 at 20:28
  • Previously the old admin CORE performed it something like this: ip dhcp pool (hostname) host (ip address) (netmask) hardware-address (mac) The example he gives me , not if it's what I want
    – dcantos
    Jun 27, 2016 at 20:31
  • 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
    – Ron Maupin
    Jun 27, 2016 at 20:35
  • @dcantos, I edited my answer for your addresses in your comment. You must first create the DHCP pool as normal, and just add an address line to associate a specific address with the MAC address.
    – Ron Maupin
    Jun 27, 2016 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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