cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

658
Views
0
Helpful
3
Replies
wfqk
Contributor

DHCP assign ip address

I want to assign static ip address to a server without bothering dhcp server. Now I can see all of the users are using ip address 10.1.1.10 – 10.1.1.50. so I assign a static ip address 10.1.1.100 to the server, do you think if this is a normal way to do that?

3 REPLIES 3
Micheline Murphy
Beginner

Hello and good Monday--your question was a little unclear, but I am going to assume that you have a DHCP server, and another server with the static IP address of 10.1.1.100.  I assume you are asking whether there's a way to exclude the other server's IP address from being handed out by the DHCP server if the statically addressed server gets shut off.

 

The short answer is yes.  You exclude the server's IP address from the DHCP pool.  As, NX-OS does not support DHCP server, only relay and snooping, this is how do it in IOS.  https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr_dhcp/configuration/12-4/dhcp-12-4-book/config-dhcp-server.html#GUID-9DFE5A79-4529-4DD9-BB7B-CB46C10E9ABE

 

I've cut-n-pasted the interesting bits below.  HTH, MM

Excluding IP Addresses

Perform this task to specify IP addresses (excluded addresses) that the DHCP server should not assign to clients.

The IP address configured on the router interface is automatically excluded from the DHCP address pool. The DHCP server assumes that all other IP addresses in a DHCP address pool subnet are available for assigning to DHCP clients.

You need to exclude addresses from the pool if the DHCP server should not allocate those IP addresses. An example usage scenario is when two DHCP servers are set up to service the same network segment (subnet) for redundancy. If the two DHCP servers do not coordinate their services with each other using a protocol such as DHCP failover, then each DHCP server must be configured to allocate from a nonoverlapping set of addresses in the shared subnet. See the "Configuring Manual Bindings Example" section for a configuration example.

SUMMARY STEPS

1.    enable

2.    configure terminal

3.    ip dhcp excluded-address low-address [high-address]


DETAILED STEPS
  Command or Action Purpose
Step 1
enable


Example:

Router> enable

 

Enables privileged EXEC mode.

  • Enter your password if prompted.
 
Step 2
configure terminal


Example:

Router# configure terminal

 

Enters global configuration mode.

 
Step 3
ip dhcp excluded-address low-address [high-address]


Example:

Router(config)# ip dhcp excluded-address 172.16.1.100 172.16.1.103

 

Specifies the IP addresses that the DHCP server should not assign to DHCP clients.

 
     

Thanks for your reply. what you are talking about is normal way to reserve ip address for for some server etc. 

 

10.1.1.100 is far way from the ip that we are using. so it would be ok. are there any way we can prevent the ip address would be assigned to other users? 

Hello and good afternoon--yes, you can always configure the DHCP pool so that some addresses never get given out.  For example, below is the configuration for DHCP_POOL.  This pool contains the addresses 172.16.0.8, .9, .10, and .11.  BUT, you can see that the .10 address has been taken out of the pool by the command ip dhcp excluded-address.

 

ip dhcp excluded-address 172.16.0.10

ip dhcp pool DHCP_POOL

 network 172.16.0.8 255.255.255.252

 default-router 172.16.0.20 

 lease 0 0 30

 

For the scenario you have described, I would create your DHCP pool with an excluded address command for the 10.1.1.100 address that you have statically assigned.  That way the DHCP server will never give out that address and you won't have to worry about duplicate addressing.  (Although, as an extra safety measure, endpoints should be ARPing for the IP that they've been assigned by the DHCP server before accepting the assignment.  If no ARP comes back, the endpoint can take the IP address without worrying that there's a duplicate out there.)

 

HTH, MM

Content for Community-Ad
This widget could not be displayed.