cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1223
Views
0
Helpful
7
Replies

DHCP config in switch and router

vishalpatil86
Level 1
Level 1

Hi,

 

I was wondering if we can configure dhcp in switch and routers such that the IP of device assigned with IP address would change if we assign same static IP to another device in the same network. does cisco support such kind of configuration?

 

Thanks,

Vish
 

7 Replies 7

Leo Laohoo
Hall of Fame
Hall of Fame

You mean you want to assign a specific IP address to a specific MAC address?  The answer is YES.

 

No.let me put it in this way--

 

There is one laptop with dhcp ip 192.168.1.1. Now, i gave the same ip address to my PC statically.

now, dhcp ip of laptop should be changed so that my PC would not give duplicate IP error.

 

Thanks,

vish

The answer is still yes.  You can assign a specific IP address, via DHCP, to a specific MAC address.   For example, 

  • Using the method of DHCP reserve, you can assign IP address 192.168.1.1 to the PC using the PC's MAC address. 
  • Using the same method, you can assign IP address 192.168.1.150 to the laptop and binding it to the MAC address of the laptop.  

 

This way, the laptop and the PC will ALWAYS get the same IP address as long as their MAC addresses don't change.

thanks leo

As far as I know it's impossible, DHCP protocol has no massage to tell the client to don't use anymore a previously assigned IP address.  

Bye,

enrico

PS rate if useful

Consider this (I will not use in a production network): if you statically assign the IP add 192.168.1.1. to the PC both host will detect a uplicate ip address. After this the first host (the one using DHCP)  will not renew the lease, instead it send a:

   DHCPDECLINE  -  Client to server indicating network address is already
                   in use.

DHCP server will  offer a new IP address and put the old one in the conflict database.

If you set a very short lease in some way you have the desired behavior but, again, it's nothing I wolud like to use ina production network

 

A little test with lease 1mnute

*Mar  1 01:31:01.183: DHCPD: DHCPDECLINE received from client 0063.6973.636f.2d63.3230.322e.3164.3234.2e30.3030.302d.4661.302f.30.
*Mar  1 01:31:01.187: DHCPD: Sending notification of TERMINATION:
*Mar  1 01:31:01.187:  DHCPD: address 192.168.123.7 mask 255.255.255.0
*Mar  1 01:31:01.191:  DHCPD: reason flags: DECLINE
*Mar  1 01:31:01.191:   DHCPD: htype 1 chaddr c202.1d24.0000
*Mar  1 01:31:01.195:   DHCPD: lease time remaining (secs) = 57
*Mar  1 01:31:01.195: DHCPD: returned 192.168.123.7 to address pool DP.
*Mar  1 01:31:01.199: %DHCPD-4-DECLINE_CONFLICT: DHCP address conflict:  client 0063.6973.636f.2d63.3230.322e.3164.3234.2e30.3030.302d.4661.302f.30 declined 192.168.123.7.
*Mar  1 01:31:01.207: DHCPD: Sending notification of DISCOVER:
*Mar  1 01:31:01.207:   DHCPD: htype 1 chaddr c202.1d24.0000
*Mar  1 01:31:01.211:   DHCPD: remote id 020a0000c0a87b0100000000
*Mar  1 01:31:01.211:   DHCPD: circuit id 00000000
*Mar  1 01:31:01.215: DHCPD: DHCPDISCOVER received from client 0063.6973.636f.2d63.3230.322e.3164.3234.2e30.3030.302d.4661.302f.30 on interface FastEthernet0/0.
*Mar  1 01:31:01.219: DHCPD: Seeing if there is an internally specified pool class:
*Mar  1 01:31:01.219:   DHCPD: htype 1 chaddr c202.1d24.0000
*Mar  1 01:31:01.223:   DHCPD: remote id 020a0000c0a87b0100000000
*Mar  1 01:31:01.223:   DHCPD: circuit id 00000000
*Mar  1 01:31:01.223: DHCPD: Allocate an address without class information (192.168.123.0)
R1#
R1#
*Mar  1 01:31:03.227: DHCPD: Adding binding to radix tree (192.168.123.8)
*Mar  1 01:31:03.227: DHCPD: Adding binding to hash tree
*Mar  1 01:31:03.231: DHCPD: assigned IP address 192.168.123.8 to client 0063.6973.636f.2d63.3230.322e.3164.3234.2e30.3030.302d.4661.302f.30.
*Mar  1 01:31:03.235: DHCPD: Sending DHCPOFFER to client 0063.6973.636f.2d63.3230.322e.3164.3234.2e30.3030.302d.4661.302f.30 (192.168.123.8).
*Mar  1 01:31:03.239: DHCPD: broadcasting BOOTREPLY to client c202.1d24.0000.
*Mar  1 01:31:03.267: DHCPD: DHCPREQUEST received from client 0063.6973.636f.2d63.3230.322e.3164.3234.2e30.3030.302d.4661.302f.30.
R1#
*Mar  1 01:31:03.271: DHCPD: Sending notification of ASSIGNMENT:
*Mar  1 01:31:03.275:  DHCPD: address 192.168.123.8 mask 255.255.255.0
*Mar  1 01:31:03.275:   DHCPD: htype 1 chaddr c202.1d24.0000
*Mar  1 01:31:03.279:   DHCPD: lease time remaining (secs) = 60
*Mar  1 01:31:03.279: DHCPD: No default domain to append - abort update
*Mar  1 01:31:03.283: DHCPD: Sending DHCPACK to client 0063.6973.636f.2d63.3230.322e.3164.3234.2e30.3030.302d.4661.302f.30 (192.168.123.8).
*Mar  1 01:31:03.283: DHCPD: broadcasting BOOTREPLY to client c202.1d24.0000.

 

thanks e.ciollaro.

As you suggested, can't use this in production network

 

Thanks,

Vishal

Review Cisco Networking products for a $25 gift card