Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Assigning a fixed IP address to a machine in a DHCP network

I want to assign a fixed private IP address to a server so that local computers can always access it.

Currently, the DHCP address of the server is something like 192.168.1.66 .

Should I simply assign the server this same IP as fixed and configure the router so that it will exclude this IP from the ones available for DHCP? Or are there some ranges of IP that are traditionally reserved for static addresses?

My beginner's question doesn't relate to commands but to general principles and good practices.

Practical case (Edit 1 of 2)

Thank you for the many good answers, especially the very detailed one from Liam.

I could access the router's configuration.

When booting any computer, it obtains its IPv4 address in DHCP.

The IP and the MAC addresses that I can see with the ipconfig all command in Windows match those in the list of connected devices that the router displays, so that I can confirm who is who.

The list of connected devices is something like

Things that I don't understand:

  • Although all IP addresses are all obtained in DCHP, they are displayed as by the router as if they are static addresses.
  • The router's setting "Enable DHCP on LAN" is set on "Off" but the IP addresses are obtained in DHCP.
  • IP addresses attributed to the computers are outside of the very narrow DHCP range of 192.168.1.33 to 192.68.1.35

On any Windows computer connected in DCHP, ipconfig /all shows something like:

I'm missing something, but what?

Practical case (Edit 2 of 2)

Solution found.

For details, see my answer to Michal's comment at the bottom of this message.

I must admit that the way the router display things keeps some parts a mystery. The router seems to be using DHCP by default, but remembers the devices that were connected to it (probably using their mac address). It could be the reason why it lists the IPs as static although they're dynamic. There was also Cisco router at 192.168.1.4 which appeared for some business communications service, but I had no credentials to access it.

Alexis Wilke's user avatar

  • There's no standard governing DHCP reservation ranges, but it would be kinda nice. –  LawrenceC Apr 5, 2018 at 2:43
  • Some routers allow you to define an IP for a chosen mac-address. Use that and DHCP will keep that address for your server. You could also set a DHCP range to e.g. 192.168.0.128 - 192.168.0.254 in a 192.168.0.1/255.255.255.0 network and set all static addresses on the "static" servers from within 192.168.0.2 - 192.168.0.127 range. –  Michal B. Apr 5, 2018 at 7:29
  • @Michal B.: I agree and did it meanwhile.: 1. Obtain the server's mac address. 2. Observe which IPs the router assigns to computers (eg. 192.168.0.50 to 192.168.1.70 ) 3. Start the server in DHCP. In the router panel, name it, basing on its mac address so that the router will remember it. 4. In the server switch IP from DHCP mode to manual and assign an IP that is beyond the ones that the router would assign to other devices (eg. 192.168.1.100 ). You can use nmtui and then edit the config file where you can replace PREFIX=32 by NETMASK=255.255.255.0 . 6. Restart the network service. –  OuzoPower Apr 6, 2018 at 9:58

7 Answers 7

Determine the IP address that is assigned to your server and then go onto the DHCP and set a DHCP reservation for that server.

JohnA's user avatar

  • 1 Reservations are essentially self-documenting. ++ –  mfinni Apr 4, 2018 at 21:30
  • 5 @mfinni ++ only works for programmers. -- for your comment :P –  Canadian Luke Apr 4, 2018 at 23:59
  • ..and yes he should also use a fixed IP, and label it. Document it. Maybe even reserve a range for this. In an enterprise using internal VPN it is common for these IP's to be hard coded in HOSTS files and SSH config files so it is a big deal when they suddenly change. –  mckenzm Apr 5, 2018 at 1:30

DHCP services differ across many possible implementations, and there are no ranges of IP that are traditionally reserved for static addresses; it depends what is configured in your environment. I'll assume we're looking at a typical home / SOHO setup since you mention your router is providing the DHCP service.

Should I simply assign the server this same IP as fixed and configure the router so that it will exclude this IP from the ones available for DHCP?

I would say that is not best practice. Many consumer routers will not have the ability to exclude a single address from within the DHCP range of addresses for lease (known as a 'pool'). In addition, because DHCP is not aware that you have "fixed" the IP address at the server you run the risk of a conflict. You would normally either:

  • set a reservation in DHCP configuration so that the server device is always allocated the same address by the DHCP service, or
  • set the server device with a static address that is outside the pool of addresses allocated by the DHCP service.

To expand on these options:

Reservation in DHCP

If your router allows reservations, then the first, DHCP reservation option effectively achieves what you have planned. Note the significant difference: address assignment is still managed by the DHCP service, not "fixed" on the server. The server still requests a DHCP address, it just gets the same one every time.

Static IP address

If you prefer to set a static address, you should check your router's (default) configuration to determine the block of addresses used for DHCP leases. You will normally be able to see the configuration as a first address and last address, or first address and a maximum number of clients. Once you know this, you can pick a static address for your server.

An example would be: the router is set to allow a maximum of 128 DHCP clients with a first DHCP IP address of 192.168.1.32. Therefore a device could be assigned any address from 192.168.1.32 up to and including 192.168.1.159. Your router will use a static address outside this range (generally the first or last address .1 or .254) and you can now pick any other available address for your server.

It depends on the configuration of your DHCP service. Check the settings available to you for DHCP then either reserve an address in DHCP or pick a static address that is not used by DHCP - don't cross the streams.

Liam's user avatar

  • 1 Double++ on this. –  ivanivan Apr 5, 2018 at 3:26
  • 1 Thank you Liam for your very detailed and useful answer. After accessing the router's configuration, other issues arised that I added in the original message. –  OuzoPower Apr 5, 2018 at 9:45
  • @OuzoPower I'm new to responding here so don't have enough rep to comment on the question. Your update shows your router is not providing the DHCP service. The setting is off on the router, and your Windows ipconfig output shows the DHCP service is provided from a device at 192.168.1.5 . Do you have Pi-Hole or another similar device providing DHCP? That's where you'll find your DHCP configuration. NB: This also explains why the router shows the addresses as static and why DHCP assigned addresses are outside the range configured on the router. –  Liam Apr 6, 2018 at 9:52
  • @Liam: No Pi-Hole or similar thing as far as I know. Solution found: As I could not set DHCP ranges in the router but could register the mac address of the server in the router and then attribute to the server a fixed IP address that is far beyond the range that the router is naturally assigning to existing devices. Thanks to the registration of the server's mac address, the router keeps it in memory and shows the server as missing when thus is off. For details, see my answer to Michal B. in the original post. This solution seems working like a charm. –  OuzoPower Apr 6, 2018 at 10:11
  • @OuzoPower That approach may work in the short term but how do you know that the address you have picked is outside the DHCP range? Many DHCP systems pick addresses at random from the available pool. At some point you will need to know what your DHCP configuration actually is, rather than estimating by observation (!) otherwise you will experience some conflict. Your question asked about best practice. Here, best practice would be to know what system is handling DHCP for your LAN. I would start by visiting 192.168.1.5 or https://192.168.1.5/ for clues. –  Liam Apr 6, 2018 at 10:48

It's not a bad habit to divide your subnet to DHCP pool range and static ranges, but of course you can do what JohnA wrote - use reservation for your server, but first case is IMHO clearer, because you are not messing up your DHCP server with unused extra settings (it could be confusing then for another admins who are not aware of that the server is static). if using DHCP pool + static pool, then just don't forget to add your static server to DNS (create A/AAAA record for it).

Journeyman Geek's user avatar

  • I would like to add that the downside of DHCP reservations for servers is that if your DHCP environment is not sufficient fault tolerant, a DHCP server outage could cause all manner of problems. Monitor the DHCP closely and set leases that are long enough to be able respond to problems even after a long weekend. –  JohnA Apr 5, 2018 at 2:06

I prefer to set my network devices, servers, printers, etc. that require a static IP address out of range of the DHCP pool. For example, xx.xx.xx.0 to xx.xx.xx.99 would be set aside for fixed IP assignments and xx.xx.xx.100 to xx.xx.xx.250 would be set as the DHCP pool.

user1780242's user avatar

  • I like this approach as well. This way I can still access the servers even if the DHCP server takes the morning off or decides to start handing out invalid leases! –  ErikF Apr 5, 2018 at 1:24
  • Using isc-dhcp-server this is required (this is what my pi does, along with DNS caching, a fake domain for my LAN, and some traffic shaping for some wireless stuff). Unfortunately, I've seen browser based router config pages (both factory and replacement) that either require a reserved address to be in the dynamic pool... or out of it. –  ivanivan Apr 5, 2018 at 3:30

In addition to the other answers I want to concentrate on the fact that your router configuration does not seem to fit the IP address configuration on your server.

Please have a look on the output of ipconfig /all:

IPv4 Address ........ 192.168.1.xx(prefered)

Default Gateway ........ 192.168.1.1 (= IP of the router)

DHCP server ............ 192.168.1.5

The clients in the network don't get the IP address from the router, but a different DHCP server in the network (192.168.1.5 instead of 192.168.1.1). You have to find this server and check it's configuration instead of the router's DHCP server config, which is seemingly only used for Wireless.

Qippix's user avatar

My router ( OpenWRT ) allows for static DHCP leases.

Static leases are used to assign fixed IP addresses and symbolic hostnames to DHCP clients.

So, you supply the MAC address of the server and it's desired IP address as a "static lease", and DHCP will always allocate the same IP. The client machine (the server in this case) requires no configuration changes and still picks up its IP address (the configured address) from DHCP.

spender's user avatar

Note that you can't assign a fixed IP addresses in 192.168 so that clients can "always access it" unless you also give each client a fixed IP address and subnet. Because if the clients use DHCP, then they get whatever subnect the DHCP server gives them, and if they use automatic addressing, then they won't be in a 192.168 subnet.

Once you realise that the system can't be easily perfected, you can see that your best options depend on what you are trying to do. Upnp is a common way of making devices visible. DNS is a common way of making devices visible. WINS is a common way of making devices visible. DHCP is a common way of making devices visible.

All of my printers have reservations: my printers aren't critical infrastructure, I want to be able to manage them, many of the clients use UPNP or mDNS for discovery anyway.

My gateway and DNS servers have fixed IP address in a reserved range: My DHCP server provides gateway and DNS addresses, and my DHCP server does not have the capacity to do dynamic discovery or DNS lookup.

None of my streaming devices have fixed or reserved IP values at all: if the network is so broken that DHCP and DNS aren't working, there is no way that the clients will be able to connect to fixed IP addresses anyway.

user165568's user avatar

  • This literally makes no sense. Are you asserting that you can’t mix static and dynamic in a /16? –  Gaius Apr 5, 2018 at 12:59
  • I have asserted that if you use static, you haven't gauaranteed that clients can "always access it"Not at all. I've just asserted that I've mixed static and dynamic in my setup. –  user165568 Apr 6, 2018 at 9:46
  • @Gaius I have asserted that if you use static, you haven't guaranteed that clients can "always access it". I'm sorry that doesn't make sense to you: it's one of the primary reasons the world moved away from static. I've also asserted that I've mixed static and dynamic in my setup: see: "none of my streaming devices have fixed or reserved" and "DNS servers have fixed IP": the DNS servers are indeed in the same subnet as the clients. –  user165568 Apr 6, 2018 at 9:52
  • Sorry, but I must admin not understanding most of your answer. As far as I know, DNS are domain name servers and are useful when you want to name servers, like when assigning domain names to web sites. As I don't need domain names, DNS appears me useless. Accessing the server is not an issue without DNS. See my answer to Michal B. in the original post for the solution that I found. –  OuzoPower Apr 6, 2018 at 10:18

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged dhcp ip-address ..

  • The Overflow Blog
  • How the co-creator of Kubernetes is helping developers build safer software
  • Trust as a service for validating OSS dependencies
  • Featured on Meta
  • Update: New Colors Launched
  • Incident update and uptime reporting

Hot Network Questions

  • What variational problem does the parabolic suspension bridge solve?
  • Freezer dripping water
  • Lighter than air vs heavier than air?
  • Can I write "paper accepted without revisions" on a CV?
  • Print ASCII building
  • Looking at Bible verses Matthew 27:46 and Mark 15:24 with Psalm 22:24 and John 16:32 did God forsaken Jesus while on the cross?
  • Book about an engineered human who can change his body and calculate the future
  • A Hidato, but with a complex twist!
  • Why are my odds ratio confidence intervals so wide?
  • Is it possible to make a full image backup of a SSD on Windows?
  • Monotone sequence beatitude
  • Is "Mutually Assured Destruction" still valid considering so many conventional missiles are currently getting shot down?
  • How to make garage door easy to manually lift for 5 year old
  • Exporting GeoPDF to GeoTIFF alters resulting TIFF in Pro and GDAL
  • Is there a name for the literary device in the expression "Thanks, I hate it."?
  • Is there an indoor cycling app where you can ride custom routes?
  • Table with additional conditions for the generated objects
  • Nonstandard infinite / hyperfinite sum in IST
  • Zassenhaus's Butterfly Lemma
  • An angle is not being calculated correctly in TikZ
  • Need Help Creating Arches Around Main Structure - Array Usage?
  • Contacting Academic about Industry Problem
  • 「買ったやつ」the guy who bought, or the thing that was bought?
  • Double Choco: Snaking

how to assign static ip in dhcp server

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy .

Configuring Static DHCP You can configure the RV110W to assign a specific IP address to a device with a specific MAC address. To configure static DHCP: Choose Networking > LAN > Static DHCP . From the VLAN drop-down menu, choose a VLAN number. Click Add Row . Enter this information: Description Enter a description of the client. IP Address Enter the IP address of the device. The IP Address assigned should be outside the pool of the DHCP addresses configured. The DHCP pool is treated as a generic pool and all reserved IP’s should be outside this pool. Static DHCP assignment means the DHCP server assigns the same IP to the defined MAC address every time the device is connected to the network. The DHCP server serves the reserved IP address when the device using the corresponding MAC address requests an IP address. MAC Address Enter the MAC address of the device. The format for the MAC Address is XX:XX:XX:XX:XX:XX where X is a number from 0 to 9 (inclusive) or an alphabetical letter between A and F (inclusive). To edit the settings of a static DHCP client, select the client and click Edit . To delete a selected DHCP client, click Delete . Click Save to apply changes.
  • Articles Automation Career Cloud Containers Kubernetes Linux Programming Security

Static and dynamic IP address configurations: DHCP deployment

%t min read | by Damon Garn

Static and dynamic IP address configurations: DHCP deployment

In my Static and dynamic IP address configurations for DHCP article, I discussed the pros and cons of static versus dynamic IP address allocation. Typically, sysadmins will manually configure servers and network devices (routers, switches, firewalls, etc.) with static IP address configurations. These addresses don’t change (unless the administrator changes them), which is important for making services easy to find on the network.

With dynamic IP configurations, client devices lease an IP configuration from a Dynamic Host Configuration Protocol (DHCP) server. This server is configured with a pool of available IPs and other settings. Clients contact the server and temporarily borrow an IP address configuration.

In this article, I demonstrate how to configure DHCP on a Linux server.

[ You might also like:  Using systemd features to secure services ]

Manage the DHCP service

First, install the DHCP service on your selected Linux box. This box should have a static IP address. DHCP is a very lightweight service, so feel free to co-locate other services such as name resolution on the same device.

Note : By using the -y option, yum will automatically install any dependencies necessary.

Configure a DHCP scope

Next, edit the DHCP configuration file to set the scope. However, before this step, you should make certain you understand the addressing scheme in your network segment. In my courses, I recommend establishing the entire range of addresses, then identifying the static IPs within the range. Next, determine the remaining IPs that are available for DHCP clients to lease. The following information details this process.

How many static IP addresses?

Figure out how many servers, routers, switches, printers, and other network devices will require static IP addresses. Add some additional addresses to this group to account for network growth (it seems like we’re always deploying more print devices).

What are the static and dynamic IP address ranges?

Set the range of static IPs in a distinct group. I like to use the front of the available address range. For example, in a simple Class C network of 192.168.2.0/24, I might set aside 192.168.2.1 through 192.168.2.50 for static IPs. If that’s true, you may assume I have about 30 devices that merit static IP addresses, and I have left about twenty addresses to grow into. Therefore, the available address space for DHCP is 192.168.2.51 through 192.168.2.254 (remember, 192.168.2.255 is the subnet broadcast address).

This screenshot from the part one article is a reminder:

spreadsheet tracking IP addresses, MAC addresses, hostnames, etc

Note : Some administrators include the static IPs in the scope and then manually mark them as excluded or unavailable to the DHCP service for leasing. I’m not a fan of this approach. I prefer that the DHCP not even be aware of the addresses that are statically assigned.

What is the router’s IP address?

Document the router’s IP address because this will be the default gateway value. Administrators tend to choose either the first or the last address in the static range. In my case, I’d configure the router’s IP address as 192.168.2.1/24, so the default gateway value in DHCP is 192.168.2.1.

Where are the name servers?

Name resolution is a critical network service. You should configure clients for at least two DNS name servers for fault tolerance. When set manually, this configuration is in the /etc/resolv.conf file.

Note that the DNS name servers don’t have to be on the same subnet as the DNS clients.

Lease duration

In the next section, I’ll go over the lease generation process whereby clients receive their IP address configurations. For now, suffice it to say that the IP address configuration is temporary. Two values are configured on the DHCP server to govern this lease time:

default-lease-time - How long the lease is valid before renewal attempts begin.

max-lease-time - The point at which the IP address configuration is no longer valid and the client is no longer considered a lease-holder.

Configure the DHCP server

Now that you understand the IP address assignments in the subnet, you can configure the DHCP scope. The scope is the range of available IP addresses, as well as options such as default gateway. There is good documentation here .

Create the DHCP scope

Begin by editing the dhcp.conf configuration file (you’ll need root privileges to do so). I prefer Vim :

Next, add the values you identified in the previous section. Here is a subnet declaration (scope):

Remember, that spelling counts and typos can cause you a lot of trouble. Check your entries carefully. A mistake in this file can prevent many workstations from having valid network identities.

Reserved IP addresses

It is possible to reserve an IP address for a specific host. This is not the same thing as a statically-assigned IP address. Static IP addresses are configured manually, directly on the client. Reserved IP addresses are leased from the DHCP server, but the given client will always receive the same IP address. The DHCP service identifies the client by MAC address, as seen below.

Start the DHCP service

Start and enable the DHCP service. RHEL 7 and 8 rely on systemd to manage services, so you’ll type the following commands:

See this article I wrote for a summary on successfully deploying services.

Don’t forget to open the DHCP port in the firewall:

Explore the DORA process

Now that the DHCP server is configured, here is the lease generation process. This is a four-step process, and I like to point out that it is entirely initiated and managed by the client, not the server. DHCP is a very passive network service.

The process is:

  • Acknowledge

Which spells the acronym DORA .

  • The client broadcasts a DHCPDiscover message on the subnet, which the DHCP server hears.
  • The DHCP server broadcasts a DHCPOffer on the subnet, which the client hears.
  • The client broadcasts a DHCPRequest message, formally requesting the use of the IP address configuration.
  • The DHCP server broadcasts a DHCPAck message that confirms the lease.

The lease must be renewed periodically, based on the DHCP Lease Time setting. This is particularly important in today’s networks that often contain many transient devices such as laptops, tablets, and phones. The lease renewal process is steps three and four. Many client devices, especially desktops, will maintain their IP address settings for a very long time, renewing the configuration over and over.

Updating the IP address configuration

You may need to obtain a new IP address configuration with updated settings. This can be an important part of network troubleshooting.

Manually generate a new lease with nmcli

You can manually force the lease generation process by using the nmcli command. You must know the connection name and then down and up the card.

Manually force lease generation with dhclient

You can also use the dhclient command to generate a new DHCP lease manually. Here are the commands:

dhclient -r to release it

dhclient (no option) to lease a new one

dhclient -r eth0 for specific NIC

Note : use -v for verbose output

Remember, if the client’s IP address is 169.254.x.x, it could not lease an IP address from the DHCP server.

Other DHCP considerations

There are many ways to customize DHCP to suit your needs. This article only covers the most common options. Two settings to keep in mind are lease times and dealing with routers.

Managing lease times

There is a good trick to be aware of. Use short lease durations on networks with many portable devices or virtual machines that come and go quickly from the network. These short leases will allow IP addresses to be recycled regularly. Use longer durations on unchanging networks (such as a subnet containing mostly desktop computers). In theory, the longer durations reduced network traffic by requiring fewer renewals, but on today’s networks, that traffic is inconsequential.

Routers and DHCP

There is one other aspect of DHCP design to consider. The DORA process covered above occurs entirely by broadcast. Routers, as a general rule, are configured to stop broadcasts. That’s just part of what they do. There are three approaches you can take to managing this problem:

  • Place a DHCP server on each subnet (no routers between the DHCP server and its clients).
  • Place a DHCP relay agent on each subnet that sends DHCP lease generation traffic via unicast to the DHCP server on a different subnet.
  • Use RFC 1542-compliant routers, which can be configured to recognize and pass DHCP broadcast traffic.

[ Getting started with containers? Check out this free course. Deploying containerized applications: A technical overview . ]

DHCP is a simple service but an absolutely critical one. Understanding the lease generation process helps with network troubleshooting. Proper planning and tracking are essential to ensuring you don’t permit duplicate IP address problems to enter your network environment.

Static and dynamic IP configurations for DHCP

Damon Garn owns Cogspinner Coaction, LLC, a technical writing, editing, and IT project company based in Colorado Springs, CO. Damon authored many CompTIA Official Instructor and Student Guides (Linux+, Cloud+, Cloud Essentials+, Server+) and developed a broad library of interactive, scored labs. He regularly contributes to Enable Sysadmin, SearchNetworking, and CompTIA article repositories. Damon has 20 years of experience as a technical trainer covering Linux, Windows Server, and security content. He is a former sysadmin for US Figure Skating. He lives in Colorado Springs with his family and is a writer, musician, and amateur genealogist. More about me

Try Red Hat Enterprise Linux

Download it at no charge from the red hat developer program., related content.

Photo of a broken pink egg with smaller eggs spilling out

  • Help Center
  • Speakers and Displays
  • Nest Thermostat
  • Cameras and Doorbell
  • Locks and Alarm Systems
  • Smoke Alarms
  • Subscriptions and Services
  • Nest Common Concerns
  • Your privacy
  • Google Nest
  • Privacy Policy
  • Terms of Service
  • Submit feedback
  • Speakers and Displays Get started Explore features Change your settings Fix a problem Warranty, manual and returns
  • Nest Thermostat Introducing Nest thermostats Get started Explore features and settings Fix a problem Warranty, manual & returns
  • Cameras and Doorbell Introducing Nest cameras and doorbells Get started Explore features and settings Fix a problem Warranty, manual & returns
  • Locks and Alarm Systems Locks Alarm Systems
  • Smoke Alarms Introducing Nest Protect Get started Explore features and settings Safety and certifications Fix a problem Warranty, manual & returns
  • Wi-Fi Learn about Wifi products Get started Features and settings Fix a problem Warranty, manual & returns Your privacy
  • Subscriptions and Services Nest Aware Partner Devices and Services Nest Renew Rush Hour Rewards HVAC monitoring Nest Pro installation ADT
  • Nest Common Concerns Nest Products Nest App Accounts Notifications and Emails
  • Features and settings
  • Network settings

DHCP IP reservation or Set a Static IP address for a device

To get the most out of Google Home, choose your Help Center: U.S. Help Center, U.K Help Center , Canada Help Center, Australia Help Center . 

When you use DHCP IP reservation, you're telling your Wi-Fi network to assign the same IP address to a specific device whenever that device connects to your network.

Why use DHCP IP reservation or Static IP

Most devices use DHCP, which assigns dynamic IP addresses, as a default. But sometimes, you want devices to always have the same IP address.

For example, a wireless printer. When you print something, your computer and printer locate each other using IP addresses. If your printer’s IP address keeps changing, your computer may not always be able to find it. Giving your printer a static IP address ensures that your computer always knows the address of your printer as it won’t change if it’s rebooted or if a DHCP IP lease expires.

  • You'll need DHCP IP reservation (Static IP for your client) if you want to set up port forwarding to that device.
  • You can customize the subnet you use under LAN settings (if you prefer to use a different subnet).
  • This article applies only to local devices connected to your router (laptop, smartphone, tablet, etc.). They can have static IP addresses that only your router sees. The outside world won’t see these static IP addresses. But your router can also have a static IP address that the rest of the internet sees. Learn about Static IP for your Wifi point’s WAN .

Change your DHCP settings

how to assign static ip in dhcp server

  • Tap the device for which you’d like to assign a static IP.

how to assign static ip in dhcp server

Note : You may need to disconnect this device from your Wi-Fi network and reconnect it before it is assigned the reserved IP.

Need more help?

Try these next steps:.

Get an answer from an expert on the Google Home Help Forum.

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Does the DHCP server know about static IP addresses set in end devices?

I have a simple setup up at home with a vendor provided ADSL router and a few home devices I connect to it to connect to the outside world. I would like one of my devices to have a static internal IP address so I can use it as a server inside my house. I have done this by just setting up a static IP address on the particular device. This seems to work. However,

Does the dhcp server in the router somehow know about this static ip address or might it try to hand out that ip address to another device that joins the networks?
  • wireless-networking

thyu's user avatar

  • 1 you should tell the router to assign a static ip to that particular client. That way, it will not give out that IP to another device. Depending on the setup, sometimes you don't even need to config the client. e.g.: my server gets its IP via DHCP, but the router has a static IP entry for it, so it ALWAYS gets the same IP. –  Russell Uhl Apr 10, 2015 at 14:23

In short the general rule of thumb is no the DHCP server will not know about this Static IP and if hands that same IP out to another device you will have an IP conflict which can take both devices offline.

You have a two options really:

Check what the DHCP scope is and make sure your static IP is outside of that scope for example if your device hands out between 192.168.0.10 to 192.168.0.200 then set the static IP to 192.168.0.210

If your DHCP router supports IP reservations you can reserve the IP so even if it is in the IP range you can tell it the Servers MAC address and it will always hand the same IP out to that device (kind of a mix of static and DHCP).

Hope that helps.

CharlesH's user avatar

  • Is this answer the complete? While working with local IT people I have had them tell me multiple times that setting the current DHCP-assigned address as a static IP is fine because the router will see it and not hand it out to another device. I can't for the life of me think of what to google to confirm this as there are a thousand pages about how to set a static IP on the local computer or at the router. Avoiding the DHCP range is best practice but my customers never have access to the router so I have to guess at the DHCP range by pinging for empty spots. –  user922020 Oct 7, 2019 at 14:49
  • 4 Hey, there is a little bit more to DHCP than what is written above, it was a simplified answer as most home routers DHCP is very basic. In terms of more expensive devices and Windows Server DHCP you do have something called 'Conflict Detection Attempts'. This setting will allow your DHCP Server to 'test' an IP to see if there is a conflict, this can normally be tweaked, if set to 0 and you have static IP's in your range could cause an IP conflict, if you up this to maybe 2 or more attempts before it will hand out the IP it can prevent conflicts...... –  CharlesH Oct 9, 2019 at 14:17
  • 3 ....However if the device with a static IP does not respond back to say 'yes I have that IP assigned statically to me', in other words if no reply comes back to the device it will still hand it out and this can cause an IP conflict. As far as I'm aware there is no DHCP service which actively scans the range to check for static IP addresses, and DHCP naively does not add static IP's to its assigned pool. Hope this helps. –  CharlesH Oct 9, 2019 at 14:20

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged networking wireless-networking router dhcp ..

  • The Overflow Blog
  • How the co-creator of Kubernetes is helping developers build safer software
  • Trust as a service for validating OSS dependencies
  • Featured on Meta
  • Update: New Colors Launched
  • Incident update and uptime reporting

Hot Network Questions

  • What variational problem does the parabolic suspension bridge solve?
  • Is it legal to bribe a private eye?
  • Nonstandard infinite / hyperfinite sum in IST
  • How is Law of Conservation of Charge valid if protons and electrons are destroyed in a system?
  • Looking for a book where there was a drug that permanently increased intelligence
  • Contractor pouring bricks into space where concrete slab will be for steps
  • Exporting GeoPDF to GeoTIFF alters resulting TIFF in Pro and GDAL
  • Definition of four-velocity: why define it with proper time of the object?
  • "He" as the antecedent of a relative pronoun
  • "Rock Paper Scissors" game
  • How do I send a scheduled reminder email to members immediately?
  • Obtaining right to copy music for private use?
  • Delete all lines after a certain number of lines
  • Is there a name for the literary device in the expression "Thanks, I hate it."?
  • A Hidato, but with a complex twist!
  • Amps at 12 and 230 volts
  • Using three different database engines in the same application?
  • When did criminal discovery rules substantially form?
  • Husband has dual citizenship Canada & UK. We reside in the UK. Will India let him in?
  • Locking myself from ever changing license
  • What considerations would have to be made for a spacecraft with minimal-to-no digital computers on board?
  • Do German speakers who would otherwise use "Sie" ever use "du" out of anger?
  • Contacting Academic about Industry Problem
  • How to compare influence of outlier in regression model. ANOVA of two models in R

how to assign static ip in dhcp server

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy .

how to assign static ip in dhcp server

How to Set a Static IP Address

August 2021

There are many reasons that you may need to change and set a static IP address for your IP device, such as a managed switch , wireless router , or outdoor access point . One reason is because an installation scenario doesn’t have an active network with DHCP services. Some other reasons you may need to set a static IP are because you use a dedicated web server, host server, VPN, or VoIP services.

Setting static IP addresses can help to avoid network conflicts which could cause certain devices to stop working correctly. However, in most installation scenarios, users will use a regular network and will not need to use a static IP. Setting a static IP address is an advanced networking function, and a basic, fundamental knowledge of TCP/IP is needed.

In general, statically address devices outside of your DHCP pool range, which in most home networks is your router . For reference, the DHCP pool range for TRENDnet products is usually (but not always) 192.168.10.101 to 199.

1. Access the Control Panel

In the Windows search bar, type in “ncpa.cpl” and then press enter.

Access the Control Panel

If you are not using Windows 10, follow the steps below instead.

  • On your keyboard, press the “Windows” and “R” keys at the same time.
  • Enter “ncpa.cpl” in the window that pops up.

Note: Network connections will display the network adapters that are currently connected to your computer.

Access the Control Panel

2. Select the Network Adapter

Right click on the network adapter that is currently connected to the device that you are trying to configure. Usually, it will be the adapter with the word “Ethernet” in the name.

Select the Network Adapter

3. Select Properties

Select “Properties” from the drop-down menu.

Select Properties

4. Select Internet Protocol Version 4 (TCP/IPv4)

Double-click on “Internet Protocol Version 4 (TCP/IPv4)”.

Select Internet Protocol Version 4 (TCP/IPv4)

5. Manually enter IP address and subnet mask

Select “Use the following IP Address” and then input the following information in the corresponding fields:

IP address: Check the device that you are connected to in order to locate the IP address. The first three sets of digits should match. For this tutorial, we will use IP address 192.168.10.10.

Subnet mask: The subnet mask between the device that you are trying to connect to needs to be the same as your PC. For this tutorial, we will use subnet mask 255.255.255.0

Manually enter IP address and subnet mask

6. Save Settings

Click the OK button on “Internet Protocol Version 4 (TCP/IPv4) Properties” window, and also click the OK button on “Ethernet Properties” window.

Note: The OK buttons must be clicked in both instances or your settings will not be saved.

7. Revert Back to DHCP

To set your computer back to DHCP, repeat steps 1-4 again. When you get to the “Internet Protocol Version 4 (TCP/IPv4) Properties” window, click “Obtain an IP address automatically”. This will allow your PC to be assigned a random IP address on your network.

Revert Back to DHCP

Operating System The operating system (often shortened to OS) is the software your computer or mobile device uses to perform basic functions. Microsoft Windows, Apple macOS, and Linux are the most popular operating systems for computers and laptops, with Android and iOS for mobile devices.

Browser A browser (short for web browser) is a software application that allows you to access the internet. Some of the most popular browsers are Chrome, Safari, Edge, Internet Explorer, and Firefox.

Network Adapter A network adapter allows a device to communicate and connect to a local area network (LAN), the internet, or other computers. Network adapters can be wired or wireless , and they can be visible or hidden from plain sight.

IP Address An IP address is a unique identifier for devices that access the internet or devices on a local area network. It uses a string of numbers and/or letters with periods or colons. To identify your IP address, type “what is my ip” into a search engine, like Google or Bing. You can also visit whatismyipaddress.com or whatismyip.com .

Dynamic IP address A dynamic IP address is an IP address that can change over time. Your IP address may change each time you connect. Most IP address assigned by your ISP will be dynamic IP addresses.

Static IP address A static IP address (also referred to as a manual IP address or static IP configuration) is an IP address that remains unchanged over time. Your IP address remains the same (or static) each time you connect (from the same location). Your IP address may change if you connect to a different network in a different location.

Cisco IOS Cookbook, 2nd Edition by Kevin Dooley, Ian Brown

Get full access to Cisco IOS Cookbook, 2nd Edition and 60K+ other titles, with a free 10-day trial of O'Reilly.

There are also live events, courses curated by job role, and more.

Allocating Static IP Addresses with DHCP

You want to ensure that your router assigns the same IP address to a particular device every time it connects.

The following commands ensure that the router assigns the same IP address to a device each time it requests one:

The router allows you to statically bind an IP address to a MAC address to ensure that a particular device always receives the same IP address. This is particularly useful for devices such as servers that must be available for access via a well-known IP address or DNS entry. Any device that accepts inbound sessions will probably require a static address. Being able to allocate these addresses via DHCP provides network administrator with greater control.

The configuration for a static DHCP mapping is slightly different than a dynamic pool. In particular, you must assign a separate dhcp pool for each static server. In our example, we created a pool named IAN to allocate a static IP address to user Ian. Also, instead of defining a network range of IP ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Don’t leave empty-handed

Get Mark Richards’s Software Architecture Patterns ebook to better understand how to design components—and how they should interact.

It’s yours, free.

Cover of Software Architecture Patterns

Check it out now on O’Reilly

Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.

how to assign static ip in dhcp server

Something went wrong. Wait a moment and try again.

  • Log in / create account
  • Privacy Policy
  • Community portal
  • Current events
  • Recent changes
  • Random page

Static DHCP

From dd-wrt wiki, [ edit ] introduction.

Static DHCP (aka DHCP reservation) is a useful feature which makes the DHCP server on your router always assign the same IP address to a specific computer on your LAN . To be more specific, the DHCP server assigns this static IP to a unique MAC address assigned to each NIC on your LAN. Your computer boots and requests its IP from the router's DHCP server. The DHCP server recognizes the MAC address of your device's NIC and assigns the static IP address to it. (Note also that, currently, each reserved IP address must also be unique. Therefore, e.g., one cannot reserve the same IP address for both the wired and wireless interfaces of a device, even though the device may be configured such that only one interface is active at any given time.)

Static DHCP will be needed if you want an interface to always have the same IP address. Sometimes required for certain programs, this feature is useful if other people on your LAN know your IP and access your PC using this IP. Static DHCP should be used in conjuction with Port Forwarding . If you forward an external WAN TCP/UDP port to a port on a server running inside your LAN, you have to give that server a static IP, and this can be achieved easily through Static DHCP.

[ edit ] Configuration

  • Log into the DD-WRT Web GUI
  • Go to the Services tab
  • DHCP Daemon should be enabled
  • If there is no blank slot under "Static Leases", click Add
  • Enter the MAC address of the client interface, the hostname of the machine, and the desired IP address for this machine. Note that you cannot reserve the same IP address for two different MAC addresses (e.g. both the wired and wireless interfaces of a device).
  • Scroll to the bottom of the page and save your changes.

Note: You must either Save or Apply the page each time you've added and filled out a new static lease. Clicking the Add button refreshes the page without saving what you entered. If you try to add multiple blank leases and fill them all out at once then you will encounter a bug that the GUI thinks they are duplicate entries.

how to assign static ip in dhcp server

Note: A blank lease duration means it will be an infinite lease (never expires). Setting a lease duration will allow you to change the static lease information later on and have the host automatically get the new information without having to manually release/renew the lease on the host.

[ edit ] DHCP Options

The DHCP system assigns IP addresses to your local devices. While the main configuration is on the setup page you can program some nifty special functions here.

DHCP Daemon : Disabling here will disable DHCP on this router irrespective of the settings on the Setup screen.

Used domain : You can select here which domain the DHCP clients should get as their local domain. This can be the WAN domain set on the Setup screen or the LAN domain which can be set here.

LAN Domain : You can define here your local LAN domain which is used as local domain for DNSmasq and DHCP service if chosen above.

Static Leases : Assign certain hosts specific addresses here. This is also a way to add hosts to the router's local DNS service (DNSmasq).

Note: It is recommended but not necessary to set your static leases outside of your automatic DHCP address range. This range is 192.168.1.100-192.168.1.149 by default and can be configured under Setup -> Basic Setup : Network Address Server Settings (DHCP) .

[ edit ] Example

To assign the IP address 192.168.1.12 and the hostname "mypc" to a PC with a network card having the MAC address 00:AE:0D:FF:BE:56 you should press Add then enter 00:AE:0D:FF:BE:56 into the MAC field, mypc into the HOST field and 192.168.1.12 into the IP field.

Remember: If you press the 'Add' button before saving the entries you just made, they will be cleared. This is normal behavior.

[ edit ] How to add static leases into dhcp by command

If more than two...just keep adding them to the static_leases variable with a space between each.

Don't forget the double quotes...if you have any spaces (more than one lease) you must include the quotes to the variable.

NOTE: Starting with build 13832 the format has changed to the following:

Note the '=' sign at the end of each lease. If you want to set static lease time then put a number after the last '=' to set time in minutes...in the second cases above a blank after the = sign means its an indefinite lease, 1440=24 hours.

If you have success setting a couple of entries, but have difficulty setting lots of entries, then you may be encountering a length limitation for your given method and firmware combination. A workaround for this is to ssh or telnet to the router and enter it there. If you still run into a length problem then you could use vi (or other method) to enter your configuration into a file and then run the file. Here is what I saved into a file and ran with success (I needed single quotes instead of double quotes in my case):

I then ran the file (which is named myiplist.sh) like so:

Also remember tools such as "nvram show | grep static" as well as "nvram commit".

[ edit ] Troubleshooting

If you cannot ping a hostname, append a period to the end. I.e. instead of "ping server" try "ping server."

If the static reservations are visible, but your machines continue to get a normal DHCP IP try going to the Setup page. Hit Save and then Apply settings. The DHCP daemon should restart and you may lose connection briefly. Try renewing your DHCP lease and you should be getting the correct IP at this point.

Categories : DHCP | Basic tutorials

  • Discussion |
  • What links here |
  • Related changes |
  • Upload file |
  • Special pages
  • | Permanent link
  • Print as PDF
  • About DD-WRT Wiki |
  • Disclaimers |
  • Powered by MediaWiki |
  • Design by Paul Gu

Static IP address assignment configuration example

Network requirements.

As shown in Figure 16 , Switch B (DHCP client) and Switch C (BOOTP client) obtain the static IP address, DNS server address, and gateway address from Switch A (DHCP server).

The client ID of VLAN-interface 2 on Switch B is:

3030-3066-2e65-3234-392e-3830-3530-2d56-6c61-6e2d-696e-7465-7266-6163-6532.

The MAC address of VLAN-interface 2 on Switch C is 000f-e249-8050.

Figure 16: Network diagram for static IP address assignment

how to assign static ip in dhcp server

Configuration procedure

Configure the IP address of VLAN-interface 2 on Switch A.

Configure the DHCP server

# Enable DHCP.

# Enable the DHCP server on VLAN-interface 2.

[SwitchA] interface vlan-interface 2

[SwitchA-Vlan-interface2] dhcp select server global-pool

[SwitchA-Vlan-interface2] quit

# Create DHCP address pool 0, configure a static binding, DNS server and gateway in it.

# Create DHCP address pool 1, configure a static binding, DNS server and gateway in it.

Verification

After the preceding configuration is complete, Switch B can obtain IP address 10.1.1.5 and other network parameters, and Switch C can obtain IP address 10.1.1.6 and other network parameters from Switch A. You can use the display dhcp server ip-in-use command on the DHCP server to view the IP addresses assigned to the clients.

© Copyright 2015 Hewlett Packard Enterprise Development LP

IMAGES

  1. DHCP Protocol

    how to assign static ip in dhcp server

  2. DHCP vs Static IP: Set Static IP or Enable DHCP in Windows 10

    how to assign static ip in dhcp server

  3. How to configure a DHCP server with static IP to a specific client

    how to assign static ip in dhcp server

  4. How to set static IP for a network device on a SonicWall firewall via DHCP

    how to assign static ip in dhcp server

  5. How to Set Up Static DHCP So Your Computer’s IP Address Doesn’t Change

    how to assign static ip in dhcp server

  6. Set a Static IP Address for a Device

    how to assign static ip in dhcp server

VIDEO

  1. 09-dhcp helper

  2. how to Authorize DHCP server and configured new scope in DHCP Server on windows server 2019 part 2

  3. Set a Static IP Address in Support Live Image

  4. Dhcp Revision

  5. DHCP Client options and Remove DHCP

  6. Configuration of DHCP

COMMENTS

  1. What Is a DHCP Host Name?

    A DHCP host name is an abbreviation for dynamic host configuration protocol, which is a standardized networking protocol used primarily for assigning dynamic IP addresses. Computers use the DHCP to request Internet Protocol parameters, incl...

  2. What Is the Difference Between DHCP and DNS?

    DHCP is what is used by the router to assign an IP address to a specific computer, while DNS is a service that translates website names into the website’s IP address. Therefore, DHCP assigns IP addresses, and DNS looks up already existing a...

  3. What Port Is Used by DHCP and the DHCP Clients?

    The DHCP server operates on UDP port 67, and the DHCP client operates on UDP port 68. These are privileged ports, and they are reserved for DHCP only. DHCP stands for Dynamic Host Configuration Protocol.

  4. Assigning a fixed IP address to a machine in a DHCP network

    DHCP services differ across many possible implementations, and there are no ranges of IP that are traditionally reserved for static addresses;

  5. Configuring Static DHCP

    Static DHCP assignment means the DHCP server assigns the same IP to the defined MAC address every time the device is connected to the network. The DHCP server

  6. Static and dynamic IP address configurations: DHCP deployment

    # yum -y install dhcp-server · # vim /etc/dhcp/dhcp. · subnet 192.168. · host fileserver3 { hardware ethernet 00:1B:44:11:B7:4A; fixed-address

  7. DHCP IP reservation or Set a Static IP address for a device

    Change your DHCP settings · Open the Google Home app . · Tap Favorites and then Wifi and then Settings and then Advanced Networking. · Tap DHCP IP reservations and

  8. Does the DHCP server know about static IP addresses set in end

    1 Answer 1 ... In short the general rule of thumb is no the DHCP server will not know about this Static IP and if hands that same IP out to

  9. How to Set Up a Static IP Address

    To set up a DHCP reservation, you need to know your IP address, which is easy enough to find out. You must then head to your router's configuration page—usually

  10. How to Set a Static IP Address

    ... DHCP services. Some other reasons you may need to set a static IP are because you use a dedicated web server, host server, VPN, or VoIP services. Setting static

  11. Allocating Static IP Addresses with DHCP

    In particular, you must assign a separate dhcp pool for each static server. In our example, we created a pool named IAN to allocate a static IP address to

  12. How to add a static IP address to a Windows DHCP server

    To add a static IP address to a Windows DHCP server, you need to perform the following steps: 1. Open the DHCP console: Go to Start, then Administrative

  13. Static DHCP

    Static DHCP (aka DHCP reservation) is a useful feature which makes the DHCP server on your router always assign the same IP address to a

  14. Static IP address assignment configuration example

    # Create DHCP address pool 0, configure a static binding, DNS server and gateway in it. [SwitchA] dhcp server ip-pool 0 [SwitchA-dhcp-pool-0] static-bind ip-