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.

Q&A for work

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

How to register hostname via DHCP?

I am a software developer and I am working on the develpoment of a network device (SIP phone). When it boots up, I want it to register a domain name on our network so that a customer can easily browse to the web interface. I have talked with the company that is developing the software for the device, and they have in other projects provided the host name in DHCP Option 12 and then that somehow (magically) gets registered in DNS with the IP address returned from the DHCP request.

So I have a test build of the software modification that includes the device setting DHCP Option 12 with a host name based on the MAC address (e.g. SIP100_0026FDF00057). However, I can not query that hostname from my Windows machine. The DHCP and DNS servers are on Windows Server.

Is there some special configuration on the DHCP and/or DNS to make this registration happen?

  • domain-name-system

wzzrd's user avatar

3 Answers 3

Windows systems that are members of a domain can automatically register their hostname in the domain DNS; but this can be done only by Windows systems.

Microsoft DHCP can be configured to register DNS names on behalf of those clients which can't do that by themselves (like Linux ones); this is what should be done if you want your device to automatically appear in your DNS. You can configure this on the DHCP server's properties.

Be careful, though, as this will mean any client will get registered in the DNS if a DHCP lease is handed to it.

More info here .

Massimo's user avatar

  • Do you know if there is a way to enable this per DHCP scope or based on the vendor class identifier of the DHCP request (Option 60)? –  chrish Oct 5, 2009 at 2:10
  • No, this is a server-level option. –  Massimo Oct 5, 2009 at 4:59
  • Comment on "only by Windows systems"... I have had good luck registering Linux clients' hostname with DHCLIENT, as long as they fall within the DHCP IP range and don't compete with existing IP assignments. –  kmarsh Oct 5, 2009 at 13:13
  • This only works if Option 81 is enabled on the DHCP server, and the scope is configured to register DNS records when requested by the client. –  Appleoddity Mar 19 at 18:04

In the Windows DHCP admin tool, right-click on the server and select Properties. Go to the DNS tab and "Enable DNS Dynamic Updates".

This is the default setting, though (I'm pretty sure), and if it's turned off, it's likely that someone turned it off for a reason. And that reason is probably to prevent it from crapping all over your DNS server. The Windows DHCP server will register names and then forget to remove them. There's a lousy workaround embedded in the Windows DNS server called "Zone Aging/Scavenging", but it has been known to delete records that you are actually using.

IMHO, the proper solution is to use a real DHCP server, like ISC DHCP , that won't forget to remove unused hostnames.

wfaulk's user avatar

  • Could you recommend alternative DHCP servers? –  Joe Internet Oct 3, 2009 at 11:09
  • ISC DHCP, linked in answer update. –  wfaulk Oct 4, 2009 at 7:18
  • "A real DHCP server"... didn't O.S. wars end quite a while ago? –  Massimo Oct 5, 2009 at 5:01
  • 3 If you want to think that the Microsoft DHCP server doesn't fail to delete expired leases from DNS, or that you can change the netmask of a scope without deleting it and reentering it, or that its interface for entering reservations is fun and exciting, in order to placate your sense of OS equality, feel free. I'm going to continue thinking it's a piece of crap. –  wfaulk Oct 5, 2009 at 6:40

I think that you should also enable option 81 in dhcp.

Igal Serban's user avatar

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged windows domain-name-system dhcp ..

  • The Overflow Blog
  • OverflowAI and the holy grail of search
  • Featured on Meta
  • Our Partnership with OpenAI
  • What deliverables would you like to see out of a working group?

Hot Network Questions

  • Calculating sample size for comparing pretest and post-test scores
  • Different words for "to want"
  • Why were these Patronuses used for these characters?
  • A generalization of derangement number
  • Why is a Schmitt trigger useful for SPI?
  • Exclude certain filename suffixes when searching using glob qualifiers
  • Polarizing paper "almost good enough", but no revision offered
  • Is there a single word (or a short phrase) meaning "to be used both in the UK and in the US"
  • A coin game - is it a group?
  • Rasmussen Equation 5.9
  • Is a PhD program the stage at which you define and carve out your own research niche?
  • How to express the notion of "from "a" to the nearest "z"" with patterns?
  • Can there be a perfect linear operator for square matrices?
  • "the girl with the red dress on" — What licenses the preposition "on"? What does it function as?
  • Consolidate Data from Multiple Columns into One Column
  • `exit` man page
  • How do you respond to this common critique of American Pragmatism?
  • Can you switch your "Replicate Magic Item" Infusion after a long rest?
  • Compute the degree of a string
  • Is Matthew 24:40 mistranslated in most English translations?
  • Is it possible to register two SSL certificates on SQLServer?
  • If a Latin sentence cannot end in a preposition, how would you say "I have never seen that before." in Latin?
  • I missed a paper from the past year which is very close to what I am doing. What should I do?
  • How to store private keys on flashdrive

can dhcp assign hostname

Configure hostname via DHCP

Author : Ingmar Verheij

Windows 8 - Hostname

Giving the device a human readable hostname makes it easier to troubleshoot issues and is sometimes required to to apply to a naming convention. Having an asset tag on the device makes it easier for a user to explain what device he/she is using.

But what if you’re unable to change the hostname of a device or don’t want to specify this for each device? Think of thin clients (or zero clients) like a HP Smart Zero Client where you can’t (or want) to configure the hostname per device.

Well, you can push the hostname via the Dynamic Host Configuration Protocol (DHCP) .

A client can be configured with static or dynamic IP configuration, by default all systems are configured with a dynamic configuration. This means that a client requests an IP configuration from a server on the network, the DHCP server. DHCP works basically works in three phases:

  • Initialization

can dhcp assign hostname

Giving the device a human readable hostname makes it easier to troubleshoot issues and is sometimes required to to apply to a naming convention. Having an asset tag on the device makes it easier for a user to explain what device he/she is using.

But what if you’re unable to change the hostname of a device or don’t want to specify this for each device? Think of thin clients (or zero clients) like a HP Smart Zero Client where you can’t (or want) to configure the hostname per device.

Well, you can push the hostname via the Dynamic Host Configuration Protocol (DHCP) .

A client can be configured with static or dynamic IP configuration, by default all systems are configured with a dynamic configuration. This means that a client requests an IP configuration from a server on the network, the DHCP server. DHCP works basically works in three phases:

  • Initialization

can dhcp assign hostname

After receiving (and confirming) an IP configuration, a DHCP lease, a timer monitors when the half of the lease time T1 (typical lease time is 8 hours, so T1 is 4 hours) is expired. A unicast is sent to the DHCP server to renew the configuration. If the renewing phase fails (for what ever reason) the same request is sent as a broadcast the Rebinding phase). After the lease expires the whole process starts from the Initialization phase.

DHCP options

Besides offering an IP address the DHCPOFFER packet contains a list op DHCP options. The most common used are:

     001 – Subnet Mask

     003 – Router

     006 – Domain Name Server

     015 – Domain Name

With BOOTP / DHCP option 012 a host name can be supplied, but only if the client requests a hostname.

Server configuration

On the DHCP server you need to specify what name (hostname) you need to give to what device (MAC address), this is done with a reservation. You need to create a reserveration for each device and therefore you need to know the MAC address of all of those device.

If your using a linux server as your DHCP server you’re probable using dhcpd (DHCP daemon) . You can add a reservation with the following lines in dhcpd.conf .

The following procedure explains how to add a reservation for a device and specify a hostname in a Windows 2008 R2 Server.

  • In the left pane, select the Address Leases in the scope where the device has a DHCP lease

can dhcp assign hostname

Client configuration

can dhcp assign hostname

In this configuration file you can specify which DHCP options the client should request (and honor) with the DHCPREQUEST packet. One of the options you can specify is:

Unfortunately Microsoft has not implemented DHCP option 012 (Host Name) in the DHCP client.

  • KB121005 – DHCP Options Supported by Clients
  • PCreview – DHCP client service with option 12

I’d like to be proven wrong , so if you know how to configure the Windows DHCP client to receive a host name let me know in the comments .

In this example a HP t510 thin client with MAC address 9C:8E:99:E7:1A:B8 got a default hostname of HP9c8e99e71ab8. If all is configured well the device requests the hostname from the DHCP server, resulting in the hostname THN-WG-2012.

can dhcp assign hostname

Gerelateerde berichten

I built a smart heat recovery system, bediening wtw, altijd op de verkeerde plek, disable “allow the computer to turn off the device to save power” for all wifi adapters.

Hello. Thanks for this so interesting post! One question, though…if there’s no DNS server in LAN, having a hostname given by a DHCP server is pretty useless, isn’t? Because, if I haven’t understood this badly, there’s no way to get the name of a client-machine from another client-machine. Am I wrong?

Thank you! Worked like a charm.

Geef een reactie Reactie annuleren

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *

Deze site gebruikt Akismet om spam te verminderen. Bekijk hoe je reactie-gegevens worden verwerkt .

nl_NL

  • Articles Automation Career Cloud Containers Kubernetes Linux Programming Security

Static and dynamic IP address configurations for DHCP

%t min read | by Damon Garn

Static and dynamic IP configurations for DHCP

IP address configuration is one of the most critical, if simple, settings on your network devices. Workstations, servers, routers, and other components must have properly assigned IP address settings to participate on the network.

This two-part article series covers static and dynamic IP address settings and the configuration of a DHCP server. This article (part one) defines network identities, contrasts static and dynamic configurations, and covers the commands needed to manage the settings. Part two covers the deployment of a DHCP server, DHCP scope configuration, and client-side management of dynamic IP addresses.

[ You might also enjoy:  The name game: Naming network interfaces in Linux ]

Three identities

Network nodes have three identities: Hostname, logical address, and physical address. These three addresses provide different types of connectivity and are used in various ways during network communication.

The three identities are:

  • Hostname - descriptive, easy to remember names for the benefit of humans
  • IP address - logical address to uniquely identify a network node, primarily used by routers
  • MAC address - physical address encoded on the network interface card (NIC), used mainly by switches

Hostnames are configured when the OS is installed, and MAC addresses are hard-coded on NICs. Sysadmins typically configure IP address information on servers, workstations, portable systems, and network devices.

I’ll cover the two primary ways that IP address information is provided to the nodes: Static and dynamic configurations.

Static and dynamic configurations:

  • Static - manually configured by sysadmins
  • Dynamic - automatically leased by clients from a Dynamic Host Configuration Protocol (DHCP) server

The standard settings are IP addresses, subnet masks, default gateways, and nameservers.

Static configuration

NetworkManager primarily handles network configuration. NetworkManager can be used in a GUI, TUI, or CLI environment.

The nmcli process to set a static IP configuration is to create a connection profile and then set the values desired. Red Hat has documentation here .

Here is an example of creating a network connection named home-network with an IP address of 192.168.2.200/24, a default gateway of 192.168.2.1, and a name server of 8.8.8.8:

The GUI configuration can be accomplished by selecting the Manual button and then filling in the blanks with the appropriate information.

GUI Network Manager screen with static IP info

Recall that you can make no typographical errors when configuring IP addresses, and duplicate addresses will cause network connection problems.

Why static configurations?

Static IP addresses do not change unless the administrator actively reconfigures them. This is an important fact when it comes to servers because most client computers need to be able to find servers consistently.

For example, an NFS file server hosting department directories needs to keep the same IP address over time as configuration files such as a client computer’s /etc/fstab file may use the IP address for connectivity.

Other network nodes also may need an unchanging network identity. Appliance devices such as firewalls or proxies, print servers, name resolution servers, web servers, and virtually all other infrastructure devices need a consistent identity. Sysadmins will almost always configure these systems with static IP address information.

Tracking IPs

It is essential to track your statically assigned IP addresses. Depending on the size of your environment, this might be so simple as a text document or a spreadsheet, all the way up to specialized software that integrates with directory services and DHCP. I find it’s best to at least track IP address (and subnet mask), MAC address (not essential), hostname, role on the network (justifies why the devices have a static IP), and any additional notes.

spreadsheet tracking IP addresses, MAC addresses, hostnames, etc

Dynamic configurations

The devices that require a static IP configuration are a relatively small percentage of your network. Most network devices are end-user systems such as workstations, laptops, phones, tablets, and other transient devices. In addition, these systems do not usually host network services that need to be discoverable by other computers.

IP address configurations are unforgiving when it comes to duplicates and typos. In addition, static IP address settings are fairly time-consuming. Finally, IP address settings tend to be temporary, especially with the advent of portable devices like laptops, phones, and tablets. To save time and reduce the chances of a mistake, dynamic IP address allocation is preferable for these kinds of nodes.

Linux systems are configured as DHCP clients by using NetworkManager.

Here is an example of adding a network connection profile configured to lease an IP address from DHCP:

By not specifying an address NetworkManager assumes the DHCP client role.

Here is a screenshot of a dynamic IP address configuration from the GUI:

Network Manager GUI and static IP configuration

The dhclient command

The dhclient command is also used to manage dynamic IP address configurations. However, in RHEL 8, network configurations, including DHCP, are handled by NetworkManager. Older RHEL versions rely on dhclient , as do some other distributions.

The ip route command displays lease information.

The second article in this series goes over the dhclient command in more detail.

[ Free cheat sheet: Get a list of Linux utilities and commands for managing servers and networks . ]  

IP address settings are crucial to network communications. Values such as the IP address, subnet mask, default gateway, and nameservers can be manually managed, but sysadmins must be very careful not to make any mistakes. Static settings don’t change unless the administrator reconfigures them, so they are essential for servers whose services are made available across the network.

Dynamic IP configurations are far more convenient for systems that don’t host network services, such as end-user devices. Furthermore, many of these devices enter and leave the network regularly, and it would be very time-consuming to set IP values each time manually. Instead, a DHCP server is used to host a pool of available addresses that client systems can lease.

Understanding the difference between static and dynamic IP addresses is straightforward but essential for administrators. As a general rule, servers and network devices utilize static, unchanging IPs, while client devices rely on dynamically allocated IP configurations.

Leasing IP addresses

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.

A blue cable plugged into a green Raspberry Pi

Select Your Language

  • Single-page

Language and Page Formatting Options

Red hat training.

A Red Hat training course is available for Red Hat Enterprise Linux

14.2. Configuring a DHCP Server

14.2.1. configuration file.

  • Parameters — State how to perform a task, whether to perform a task, or what network configuration options to send to the client.
  • Declarations — Describe the topology of the network, describe the clients, provide addresses for the clients, or apply a group of parameters to a group of declarations.

Example 14.1. Subnet Declaration

Example 14.2. Range Parameter

Example 14.3. Static IP Address Using DHCP

Example 14.4. Static IP Address Using DHCP on Multiple Interfaces

Example 14.5. Shared-network Declaration

Example 14.6. Group Declaration

14.2.2. Lease Database

14.2.3. starting and stopping the server.

  • -p portnum — Specifies the UDP port number on which dhcpd should listen. The default is port 67. The DHCP server transmits responses to the DHCP clients at a port number one greater than the UDP port specified. For example, if the default port 67 is used, the server listens on port 67 for requests and responds to the client on port 68. If a port is specified here and the DHCP relay agent is used, the same port on which the DHCP relay agent should listen must be specified. See Section 14.3, “DHCP Relay Agent” for details.
  • -f — Runs the daemon as a foreground process. This is mostly used for debugging.
  • -d — Logs the DHCP server daemon to the standard error descriptor. This is mostly used for debugging. If this is not specified, the log is written to /var/log/messages .
  • -cf filename — Specifies the location of the configuration file. The default location is /etc/dhcp/dhcpd.conf .
  • -lf filename — Specifies the location of the lease database file. If a lease database file already exists, it is very important that the same file be used every time the DHCP server is started. It is strongly recommended that this option only be used for debugging purposes on non-production machines. The default location is /var/lib/dhcpd/dhcpd.leases .
  • -q — Do not print the entire copyright message when starting the daemon.

Quick Links

  • Subscriptions
  • Support Cases
  • Customer Service
  • Product Documentation
  • Contact Customer Portal
  • Customer Portal FAQ
  • Log-in Assistance
  • Trust Red Hat
  • Browser Support Policy
  • Accessibility
  • Awards and Recognition

Related Sites

  • developers.redhat.com
  • connect.redhat.com
  • cloud.redhat.com

Systems Status

  • Red Hat Subscription Value
  • About Red Hat
  • Red Hat Jobs

Red Hat legal and privacy links

  • Contact Red Hat
  • Red Hat Blog
  • Diversity, equity, and inclusion
  • Cool Stuff Store
  • Red Hat Summit
  • Privacy statement
  • Terms of use
  • All policies and guidelines
  • Digital accessibility

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Step-by-Step: Configure DHCP Using Policy-based Assignment

Updated: May 27, 2016

Applies To: Windows Server 2012, Windows Server 2012 R2

The Dynamic Host Configuration Protocol (DHCP) server role in Windows Server 2012 introduced a new policy based IP address assignment feature. Policy based assignment (PBA) allows an administrator to group DHCP clients by specific attributes based on fields contained in the DHCP client request packet. This feature allows for targeted administration and greater control of configuration parameters delivered to network devices.

In this guide

This guide provides step-by-step instructions for deploying DHCP policy based assignment in a test lab using one server computer and two client computers. Software and hardware requirements are provided, as well as an overview of DHCP policy based assignment.

The following instructions are for configuring a test lab using the minimum number of computers. Individual computers are needed to separate the services provided on the network and to clearly show the desired functionality. This configuration is neither designed to reflect best practices nor does it reflect a desired or recommended configuration for a production network. The configuration, including IP addresses and all other configuration parameters, is designed only to work on a separate test lab network.

DHCP policy based assignment overview

With a DHCP server running Windows Server 2012 or Windows Server 2012 R2, administrators can define an address assignment policy at the server level or scope level. A policy contains a set of conditions to evaluate when processing client requests. Policy based assignment enables flexibility for some common scenarios, including:

Multiple device types : A network includes many different DHCP client devices, such as printers, IP phones, and desktops. Administrators need the ability to classify these devices using different IP address ranges. This enables router policies and quality of service (QoS) based on IP address range policies to control network access or traffic. For example, you can add a vendor class of “Hewlett-Packard JetDirect” or Cisco Systems, Inc. IP Phone CP-7940G and configure printer and IP-phone policies to assign a specific IP address range to these devices.

Multiple roles : A network includes different types of computers, such as laptops, desktops, and servers in the same subnet. Depending on the type of client, the administrator might wish to provide different lease duration settings. All the wireless clients that connect via a specific relay agent can be assigned a four-hour lease duration. DNS dynamic update protocol can be disabled for clients matching this policy. Similarly, a server policy can be created using a list of server MAC addresses. Servers can be assigned a 12-day lease duration

Virtualization : A data center network employs virtualization for different workloads and applications. Virtual machines are added and removed dynamically depending upon load requirements at a given time. An administrator wishing to route traffic on the network differently for VMs can create a policy based on MAC address prefix to assign a short lease duration, specific IP address range, and different default gateway.

The following fields in the DHCP client request are available when defining policies.

Vendor Class

MAC address

Client Identifier

Relay Agent Information

Policy settings and evaluation

Policy settings can be of three types.

IP address range : The IP address range within a scope from which to assign an IP address to a client. A server level policy cannot have a setting for an IP address range.

Standard DHCP options : One or more standard DHCP options to send to a client in the response based on the options requested by the client in the parameter request list.

Vendor specific DHCP options : One or more vendor specific DHCP options to send to the client based on the vendor class field in the client request.

The DHCP server evaluates policies sequentially according to an assigned processing order. The DHCP administrator assigns the processing order to the policies. If policies exist at the server and scope levels, the server applies both sets of policies and evaluates the scope policies before the server policies. The processing order for a scope level policy defines the order of evaluation within the scope. If there are no policies defined at the scope level, the policies at the server level apply to the scope.

Address assignment

The DHCP server determines the scope to which a DHCP client belongs based on the gateway IP address of the relay agent or the interface of the DHCP server on which it receives the DHCP client packet. Once the server determines the client scope, the server evaluates the DHCP packet against the policies applicable for the scope in the processing order specified. The policies applicable at a scope are those configured at the scope and those inherited from the server. A single client request can match multiple policies.

If a client request matches the conditions of a policy for which a specific IP address range is associated, the server will assign the first free IP address from the range as determined by the rule. If a policy is associated with multiple address ranges, the server will assign IP addresses by first attempting to assign an IP from the lowest address range. If no IP addresses are available to use from the lower address range, the server will then look for a free IP address from the higher address ranges. If no IP addresses are free from any of the address ranges associated with the policy, the server will process the next matched policy as defined by the processing order.

If none of the matched policies has a free IP address, the server will drop the client packet and log an event. If a DHCP client packet does not match any of the policies applicable for the scope, or none of the matched policies for a client packet is associated with an IP address range, the server will lease the client an IP address from the IP address range configured for the scope exclusive of any policy-specific IP address ranges.

Option assignment

A DHCP client uses the parameter request list field in a DHCP packet to request a list of standard options from the server. The option assignment processing for a client is similar to that of IP address assignment. The DHCP server evaluates the fields in the client request against each policy applicable for the scope in the processing order specified. If the client request matches the conditions of any of the policies applicable for the scope, and its settings include specific options, the server returns these options to the client. If multiple policies match the client request, the server returns the sum of the options specified for each of the matched policies. The DHCP server sends vendor class options to the client based on the vendor class contained in the DHCP client request.

Scenario overview

This test lab demonstrates new DHCP functionality in Windows Server 2012 or Windows Server 2012 R2. One server computer and two client computers are used. See the following figure.

can dhcp assign hostname

Hardware and software requirements

One server computer and two client computers are required to complete the test lab.

The following are required components of the test lab:

The product disc or other installation media for Windows Server 2012 or Windows Server 2012 R2.

One computer that meets the minimum hardware requirements for Windows Server 2012 or Windows Server 2012 R2.

At least one DHCP client computer is required.

The lab uses two computers running Windows® 8. If only one client computer is available, or clients are not running Windows 8, you must alter some of the procedures in the test lab accordingly.

Steps for configuring the test lab

The following procedures are used to configure computers for the demonstration portion of the test lab:

Configure DHCP1 : DHCP1 is a domain controller, DNS server, and DHCP server for the contoso.com Active Directory domain.

Configure Client1 : Client1 is a DHCP client computer.

Configure Client2 : Client2 is a DHCP client computer.

Configure DHCP1

DHCP1 is a computer running Windows Server 2012 or Windows Server 2012 R2, providing the following services:

A domain controller for the contoso.com Active Directory domain.

An authoritative DNS server for the contoso.com DNS zone.

A DHCP server.

Initial configuration of DHCP1 consists of the following steps:

Install the operating system and configure TCP/IP on DHCP1

Install ad ds, dns server, and dhcp server, create a domain administrator account, create a dhcp scope on dhcp1, to install the operating system and configure tcp/ip on dhcp1.

Start your computer using the Windows Server 2012 or Windows Server 2012 R2 product disc or other digital media.

When prompted, enter a product key, accept license terms, configure clock, language, and regional settings, and provide a password for the local Administrator account.

Press Ctrl+Alt+Delete and sign-in using the local Administrator account.

If you are prompted to enable Windows Error Reporting, click Accept .

Click Start , type ncpa.cpl , and then press ENTER . The Network Connections control panel will open.

The previous step demonstrates the functionality in Windows Server 2012 or Windows Server 2012 R2 that enables you to search and run applications, settings, and files by clicking Start and then typing a search term. You can also open the Network Connections control panel by clicking next to Ethernet in Server Manager using the Local Server view. For more information, see Common Management Tasks and Navigation in Windows Server 2012 ( https://go.microsoft.com/fwlink/p/?LinkId=242147 ).

In Network Connections , right-click Ethernet and then click Properties .

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

On the General tab, choose Use the following IP address .

Next to IP address type 10.0.0.1 and next to Subnet mask type 255.255.255.0 . It is not necessary to provide an entry next to Default gateway .

Next to Preferred DNS server , type 10.0.0.1 .

Click OK twice, and then close the Network Connections control panel.

DHCP1 will serve as a domain controller, DNS server, and DHCP server for the contoso.com Active Directory domain.

To configure DHCP1 as a domain controller, DNS server, and DHCP server

The Server Manager Dashboard is displayed by default. In the navigation pane, click Configure this local server .

Under PROPERTIES , click the name next to Computer name . The System Properties dialog box will open.

On the Computer Name tab, click Change and then type DHCP1 under Computer name .

Click OK twice, and then click Close .

When you are prompted to restart the computer, click Restart Now .

After restarting the computer, sign-in using the local Administrator account.

In Server Manager, under Configure this local server , click Add Roles and Features .

In the Add Roles and Features Wizard , click Next three times, and then on the Select server roles page select the Active Directory Domain Services checkbox.

When you are prompted to add required features, click Add Features .

Select the DHCP Server checkbox.

Select the DNS Server checkbox.

Click Next five times, and then click Install .

Wait for the installation process to complete, verify on the Installation progress page that Configuration required. Installation succeeded on DHCP1 is displayed, and then click Close .

Click the Notification flag and then click Promote this server to a domain controller . See the following example.

can dhcp assign hostname

In the Active Directory Domain Services Configuration Wizard , on the Deployment Configuration page, choose Add a new forest and then next to Root domain name , type contoso.com .

Click Next , and then on the Domain Controller Options page, under Type the Directory Services Restore Mode (DSRM) password , type a password next to Password and Confirm password . Confirm that Domain Name System (DNS) server and Global Catalog (GC) are selected, and then click Next .

Click Next four times, verify that All prerequisite checks passed successfully is displayed, and then click Install .

The computer will restart automatically to complete the installation process.

Sign in using the local Administrator account.

A domain administrator account is required to configure settings in the test lab.

You can use the CONTOSO\Administrator account in this test lab and skip creation of a domain administrator account if desired. This account has domain administrator privileges, and other privileges. However, it is a best practice to disable or rename this account. For more information, see Active Directory Best Practices ( https://go.microsoft.com/fwlink/p/?LinkID=243071 ).

To create a domain administrator account

On the Server Manager menu bar, click Tools , and then click Active Directory Users and Computers .

In the Active Directory Users and Computers console tree, double-click contoso.com , right-click Users , point to New , and then click User .

In the New Object – User dialog box, type user1 under User logon name and next to Full name , then click Next .

Next to Password and Confirm password , type a password for the user1 account.

Clear the checkbox next to User must change password at next logon , select the Password never expires checkbox, click Next , and then click Finish .

Click the Users folder, and then double-click user1 and then click the Member Of tab.

Click Add , type domain admins under Enter the object names to select , click OK twice, and then close the Active Directory Users and Computers console.

Click Start , click Administrator , and then click Sign out .

Sign in to the computer using the user1 credentials. Click Other user and then type the user1 name and password.

Next, create a DHCP scope on DHCP1.

To create a DHCP scope on DHCP1

On the Server Manager menu bar, click Tools and then click DHCP . The DHCP console opens.

In the DHCP console tree, navigate to IPv4 . Right-click IPv4 and then click New Scope . The New Scope Wizard opens.

Click Next and then type a name for the new scope next to Name (ex: Contoso-scope1).

Click Next and then in IP Address Range , type 10.0.0.1 next to Start IP address , type 10.0.0.254 next to End IP address , and type 24 next to Length . The value of Subnet mask will change automatically to 255.255.255.0 .

Click Next , and then in Add Exclusions and Delay type 10.0.0.1 under Start IP address , type 10.0.0.10 under End IP address , and then click Add . This allows the first ten IP addresses in the 10.0.0.0/24 subnet to be used for static addressing of servers on the network.

Click Next and then in Lease Duration under Limited to enter 0 Days , 0 Hours , and 2 Minutes . This very short lease duration will simplify the DHCP demonstration.

Click Next three times, and then in Domain Name and DNS Servers , verify that the Parent domain is contoso.com and 10.0.0.1 is listed as the only DNS server.

Click Next twice, and then in Activate Scope select Yes, I want to activate this scope now .

Click Next , and then click Finish .

In the DHCP console tree, right-click dhcp1.contoso.com , and then click Authorize .

Refresh the view in the DHCP console and verify that DHCP1 is authorized and that the Contoso-scope1 is active.

Note: To review scopes on the current server using Windows PowerShell, right-click Windows PowerShell , click Run as Administrator , click Yes in the User Account Control alert that appears, and then type the following command at the Windows PowerShell prompt, and then press ENTER.

Configure Client1

Client1 is a computer running Windows® 8 that is acting as a DHCP client.

Configuration of Client1 consists of the following steps:

Install the operating system on Client1

Pin windows powershell to the taskbar.

During the demonstration portion of the test lab, Client1 will be used as a DHCP client.

To install the operating system on Client1

Start your computer using the Windows 8 product disc or other digital media.

When prompted, enter a product key and accept license terms.

When prompted to enter a computer name, type Client1 and click Next .

Click Use express settings .

On the Sign in to your PC page, click Don’t want to sign in with a Microsoft account and then click Local account .

Next to User name , type user1 , enter a password and password hint, and then click Finish .

The DHCP failover demonstration on Client1 makes use of Windows PowerShell to verify DHCP lease information. To make Windows PowerShell more easily accessible, it will be pinned to the taskbar.

To pin Windows PowerShell to the taskbar

The Start menu is displayed by default. If Start is not displayed, move the mouse cursor to the lower left corner of the screen until Start is displayed, and then click Start .

Type powershell and then under Results for “powershell” right-click Windows PowerShell and then click Pin to taskbar .Confirm that Windows PowerShell is pinned to the taskbar.

Client1 can also be joined to the contoso.com domain; however this is not required to complete the test lab.

Configure Client2

Client2 is a computer running Windows 8 that is acting as a DHCP client.

Configuration of Client2 is nearly identical to Client1. To configure Client2, repeat the identical procedures used to configure Client1, except when you enter a computer name, type Client2 instead of Client1.

DHCP policy based assignment demonstration

For the DHCP policy based assignment demonstration portion of the test lab, a MAC address based policy will be configured to assign unique DHCP options and IP address ranges to Client1 and Client2.

A demonstration of DHCP policy based assignment on Windows Server 2012 or Windows Server 2012 R2 consists of the following procedures:

Determine MAC addresses

Create policies, demonstrate policies.

Unique MAC addresses on Client1 and Client2 will be used to match different DHCP policies.

To determine MAC addresses

On DHCP1, open the DHCP console and navigate to IPv4\Scope [10.0.0.0] Contoso-scope1\Address Leases .

Click Address Leases and then in the details pane write down the MAC addresses listed for Client1 and Client2 under Unique ID .

can dhcp assign hostname

The DHCP Policy Configuration Wizard will be used to create a unique policy for Client1 and another policy for Client2. A policy configured for an individual computer is not typical and is only configured for demonstration purposes. On a corporate network, you can use wildcards and other conditions to match multiple DHCP client devices.

To create policies

In the DHCP console, under Scope , right-click Policies and then click New Policy .

Ensure that you select the Policy folder under the Scope folder. This is the scope-level folder. The other Policies folder is for server-level policies and if you create a policy there you will not be able to create the IP address range policy for this exercise.

Next to Policy Name , type Client1 Policy , and then click Next .

On the Configure Conditions for the policy page, click Add .

In the Add/Edit Condition dialog box, choose MAC Address next to Criteria , type the MAC address for Client1 next to Value (001DB7A63D in this example), and then click Add , then click OK .

can dhcp assign hostname

Click Next , and then in Configure settings for the policy , type 10.0.0.100 next to Start IP address and type 10.0.0.199 next to End IP address .

can dhcp assign hostname

Click Next , and then under Available Options , select 003 Router , type 10.0.0.7 under IP address , and click Add .

Repeat the previous steps for Client2 using the following conditions, IP address ranges, and options:

Policy Name : Client2 Policy

Condition : MAC Address equals (in this example) 00155DB7A63E.

Start IP address : 10.0.0.200

End IP address : 10.0.0.254

003 Router : 10.0.0.8

Next, review the effect that these policies have on the IP address configuration of Client1 and Client2.

To demonstrate policies

In the details pane, under Policy Name , right-click one of the two policies you just created.

Note that you can move the policy up or down in the processing order, delete the policy, or disable the policy.

Click Properties .

Review the available parameters that you can edit on the General , Conditions , IP Address Range , Options , and DNS tabs.

Click OK , and then on Client1 type ipconfig /all at the Windows PowerShell prompt.

can dhcp assign hostname

Client1 has been assigned the first IP address in the 10.0.0.100 – 10.0.0.199 range, and a default gateway of 10.0.0.7, as determined by the policy based assignment.

If the IP address hasn't changed yet, you can type ipconfig /release and then ipconfig /renew to get a new lease.

Repeat the previous step on Client2.

can dhcp assign hostname

Client2 has been assigned the first IP address in the 10.0.0.200 – 10.0.0.254 range, and a default gateway of 10.0.0.8.

Policy based assignment in Windows Server 2012 or Windows Server 2012 R2 DHCP allows you to create simple yet powerful rules to administer DHCP on your network.

Additional resources

[LAN] How to set up DHCP Server on ASUS Router?

Send the page link to your email

Please enter your email

can dhcp assign hostname

Scan QR code to open this page with your smart phone.

What is DHCP?

DHCP (Dynamic Host Configuration Protocol)  is a protocol for the automatic configuration used on IP networks. The DHCP server can assign each client an IP address and informs clients of the DNS server IP and default gateway IP.

Go to router settings page(Web GUI)

Step1 . Connect your computer to the router via wired or WiFi connection and enter  your router LAN IP  or router URL https://www.asusrouter.com to the WEB GUI.

can dhcp assign hostname

Please refer to  How to enter the router setting page(Web GUI) (ASUSWRT)?  to learn more. 

Step2 . Key in your router's username and password to log in.

can dhcp assign hostname

Note:  If you forget the user name and/or password, please restore the router to the factory default status and setup. 

          Please refer to  [Wireless Router] How to reset the router to factory default setting?   for how to restore the router to default status.

Step3 . Go to  LAN > " DHCP Server " tab.

can dhcp assign hostname

Function description

(1) Enable the DHCP Server

     Enable the DHCP server function to allow the router's DHCP server to automatically assign IP addresses to network clients.

     If this function is disabled, you'll need to assign the IP address for your LAN devices manually.

can dhcp assign hostname

(2)  You can name your router for clients who request IP address from the DHCP Server. It can only contain alphanumeric characters and dash symbol.

can dhcp assign hostname

(3)  You can configure the first and the last address in the pool to be assigned by DHCP server in LAN.

      For example, if router’s LAN IP is 192.168.50.1, you can configure your IP Pool address as 192.168.50.2 to 192.168.50.254.( A total of 253 IPs )

can dhcp assign hostname

(4)  Set the lease time that the network client is allowed to use its current IP address to connect to the wireless router.

     When the lease time expires, the network client should either renew or get a new IP address form the wireless router's DHCP server. Default is set to 86400 seconds.

can dhcp assign hostname

(5)  You can configure the IP address of gateway in your LAN. If you leave it blank, the IP address of the router would be assigned.

can dhcp assign hostname

(6) DNS Server:  You can configure the IP address of DNS to provide clients who request IP address from DHCP server. If you leave it blank, the DNS request would be processed by the router.

      WINS Server:  The Windows Internet Naming Service manages interaction of each PC with the Internet. If you use a WINS server, please enter IP address of server.

can dhcp assign hostname

(7)  If you want to manually assign IP for devices. Enable Manual Assignment, and then you can see device's name in MAC address. Choose the device you want to configure.

can dhcp assign hostname

(8)  After choosing, you'll see the device's MAC address and its IP address, which is used now. You can set that IP address directly or manually modify the IP address to whatever you want.

     Then, click Add/Delete button.

can dhcp assign hostname

(9)  Last, c lick  Apply  to save the setting

can dhcp assign hostname

How to get the (Utility / Firmware)?

You can download the latest drivers, software, firmware and user manuals in the  ASUS Download Center .

If you need more information about the  ASUS Download Center , please refer to this  link .

Was this information helpful?

What we can do to improve the article?

  • Above information might be partly or entirely quoted from exterior websites or sources. please refer to the information based on the source that we noted. Please directly contact or inquire the sources if there is any further question and note that ASUS is neither relevant nor responsible for its content/service
  • This information may not suitable for all the products from the same category/series. Some of the screen shots and operations could be different from the software versions.
  • ASUS provides the above information for reference only. If you have any questions about the content, please contact the above product vendor directly. Please note that ASUS is not responsible for the content or service provided by the above product vendor.
  • Brand and product names mentioned are trademarks of their respective companies.

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.

Q&A for work

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

How to edit Wi-Fi router DHCP clients name?

I Have a TP-Link router where 6 or 7 devices are connected. But these devices names are shown like this (android-8e1336e02e213bef). I want to edit their names just to identify who is connected through my router. But there is no option in web-ui where I can edit their hostname. Is it possible to edit their hostname from My PC? If then, How?

These Devices are connected through my router. I want to edit their hostname.

  • wireless-router

Ahmed Ashour's user avatar

3 Answers 3

The router just reports the name that each device gives it when they connect. You have to change the device's name in the device's operating system itself. For instance, in Windows 10, you would go to Settings > System > About, and then click the "Change Name" button on the resulting page. When installing an OS, one is usually asked to set a hostname for the machine, and if that is ignored, some default name is given.

kreemoweet's user avatar

You cannot change the host names from the PC.

For android devices, go to Settings > About your phone > Edit the hostname there.

For windows computers/laptops, @kreemoweet has shown a way. Just you have to do a restart after completing the steps.

The router admin page shows the friendly host names of the DHCP clients (devices connected).

Wasif's user avatar

  • Doesn't work for me. My phone has its name correctly set in Settings > About, but my router still displays it as "Unknown" in the devices list. –  dotNET Sep 13, 2022 at 2:36

If u are using an iphone with IOS 16.xxx:

  • In settings->WiFi, select your network name.
  • Select the ‘i’ (information) button for that network name.
  • Change the privacy button to off.
  • The device name in the General->about field will display only for that network.
  • Do that for every IOS device on the network.

K. Alexander's user avatar

You must log in to answer this question.

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

  • The Overflow Blog
  • OverflowAI and the holy grail of search
  • Featured on Meta
  • Our Partnership with OpenAI
  • What deliverables would you like to see out of a working group?

Hot Network Questions

  • Why is a Schmitt trigger useful for SPI?
  • Image recognition in air to air missiles
  • Calculating sample size for comparing pretest and post-test scores
  • How will hitting the gym trigger the effect of the drug?
  • Vrock spores question
  • Book about machinery at a long-abandoned mining colony that develops AI to keep mining
  • Do tenants need consent to sublease?
  • Confused by 付いてくる and the particle usage
  • Is a dome really the most efficient way to contain gas in a vacuum?
  • Does suspending judgment require judgment?
  • I missed a paper from the past year which is very close to what I am doing. What should I do?
  • Is it possible to register two SSL certificates on SQLServer?
  • Unable to change file ownership through find-exec
  • Exclude certain filename suffixes when searching using glob qualifiers
  • Did Einstein ever say "Then I would feel sorry for the good Lord. The theory is correct." about the theory of relativity?
  • Director forcing an all day meeting on an off day before a holiday
  • How would time dilate for pioneers travelling to Alpha Centauri Cb?
  • How does this ramp generator circuit work?
  • How do I attach an axle/wheel to an aluminum frame using n55 DIY document?
  • How do companies benefit from an increase in the share price of the company
  • Why were these Patronuses used for these characters?
  • Average energy in Boltzmann statistics
  • Counting consecutive units in nested lists
  • How to maintain good boundaries when manipulative co-worker and boss have years-long relationship at previous jobs?

can dhcp assign hostname

How-To Geek

How to set up static dhcp so your computer's ip address doesn't change.

DHCP makes it simple to configure network access for your home network, and port forwarding makes it easy to those computers from anywhere.

Quick Links

The problem with dhcp and port forwarding, finding your mac address, dd-wrt and static dhcp.

DHCP makes it simple to configure network access for your home network, and port forwarding makes it easy to those computers from anywhere. By configuring static DHCP on your router, you can combine the best of both worlds.

DHCP is great. You configure your router to automatically assign IP addresses and the computers on your network just plain work. Port forwarding is useful because you can access your router from outside of your network and be redirected to the computer you need inside of your network. The problem is that these two wonderful things rely on one premise: your internal IP addresses don’t change. If your router changes the IP that is assigned to a machine by DHCP, then you have to reconfigure Port Forwarding. Many programs try to get around this fact by offering Universal Plug and Play (UPnP) port forwarding features, but not everything does.

Newer routers often have the ability to remember which IP address was assigned to which computer, so if they disconnect and reconnect their IP doesn’t change. Often, though, a router reset will wipe this cache and start assigning IPs on a first-come, first-served basis. Tons of older routers don’t even have this ability, and immediately assign new IP addresses. With IP addresses changing, you have to reconfigure your port forwarding settings often, otherwise you may lose the ability to connect to your home computers.

You can do this on plenty of modern routers, but we're going to use DD-WRT for this guide. We’ve touted DD-WRT’s ability many times before, and it’s not for nothing. This amazing custom router firmware has a solution to this mess: static DHCP, also known as DHCP reservation. While configuring your router for DHCP, you have the ability to enter the MAC addresses of your computers’ network cards and enter which IP address to assign them. DD-WRT will automatically take care of the rest! If you have a different router, you can try following along using your router's own admin page--the instructions should be somewhat similar.

The only real work you’ll have to do is find the MAC address of each computer’s attached networking card. If you’re using wireless then you should find the MAC of your wireless card, and if you’re wired then use the Ethernet card.

Just go down to the icon in your system tray for your connection and click it. Mine is wireless.

Right-click on your current active connection and click on Status.

Click on the “Details…” button.

Your MAC address for this device is listed as “Physical Address.”

OS X users can check under their System Settings and click on Network. If you click on the various tabs for your connection, you should find a “Physical ID,” “Ethernet ID,” or “MAC Address.” Ubuntu users can type “ifconfig” in Terminal. You’ll see various network adapters, each displaying its own hardware address. Do this for all of the computers in your network that you need port forwarding for. The others will just get their IPs assigned automatically by DHCP.

Now that you have a list of MAC addresses for each of your computers, open up a browser tab and head over to your router’s DD-WRT interface. Click on Setup, and under Basic Setup, make sure DHCP is turned on.

Scroll down to “Network Address Server Settings (DHCP)” and make a note of the starting IP address and the maximum number of users. The addresses you configure should fall within this range. Here, my range of IPs would be 192.168.1.100 – 192.168.1.114.

Now, click on the Services tab up top.

Under the DHCP Server section, you can see that there’s a list of “Static Leases” click on the Add button to add a new one.

Enter the MAC address of each computer, give each one a name so you know which is which, and then assign them an IP address. You won’t be able to add the same IP address to two different MAC address, so make sure each MAC has a unique IP. If your version of DD-WRT also has a space to enter the “Client Lease Time,” a safe setting would 24 hours, or 1440 minutes.

That’s it! Be sure to click on both the Save button and the Apply Settings button, and wait for the changes to take effect. The settings should automatically change when each computer’s lease expires, though you can reconnect from each computer if you want the changes to take effect immediately.

Now, whether your computer loses its connect, the router gets power cycled, or the DHCP lease expires, each computer you entered into the list will stick to its assigned IP. Furthermore, you won’t have to manually configure static IPs on each machine! Port forwarding won’t have to be a pain ever again.

Does your router support DHCP reservations? Do you have a more clever use for this system? Share your thoughts in the comments!

Red Hat OpenShift 101 for OpenStack admins: Configuration

Feature image for Red Hat OpenShift

In the previous post , we oversaw the required  Red Hat OpenShift Container Platform   operators , their roles, and the format used to create the  Red Hat OpenStack Services on OpenShift (RHOSO) control plane. In this article, let’s review the deployment process.

We’ll base our observations on the Development Preview 3 code from  https://github.com/rh-osp-demo/dp-demo/ .

Let’s begin with the OpenStack Operator.

The OpenStack Operator

The OpenStack Operator consists of three parts (a CatalogSource , an OperatorGroup , and a Subscription ), each defining a different resource for managing Operators within an OpenShift/ Kubernetes cluster using the Operator Lifecycle Manager (OLM). The resources aim to set up an Operator for OpenStack, likely for managing OpenStack services within the cluster, are as follows:

These resources collectively set up an environment where the OpenStack Operator is available to be installed in the  openstack-operators namespace. The CatalogSource provides the metadata about available operators, including the OpenStack Operator, sourced from a specified image. The OperatorGroup defines the scope within which the Operator can operate, and the Subscription triggers the installation and management of the OpenStack Operator according to the specified channel and source catalog.

Let’s focus on the CatalogSource part:

  • name: openstack-operator-index  - The name of the CatalogSource .
  • namespace: openstack-operators - The namespace where the CatalogSource is created.
  • sourceType: grpc   - Indicates that the catalog source uses gRPC to serve the index of available operators.
  • secrets: A list of secrets, in this case, osp-operators-secret , that might be used by the catalog source, potentially for accessing private repositories.
  • gprcPodConfig : Contains configuration specific to the pod serving the gRPC requests.
  • securityContextConfig: legacy - Specifies a security context configuration for the pod. The exact meaning of "legacy" can depend on the cluster configuration.
  • image : The container image URL for the operator index image, which should be adjusted to match the environment. This image hosts metadata about the operators available for installation, including the OpenStack operator.

Network isolation

Now that the operator is installed, let’s prepare the networking for the control plane, then the data plane.

First, we’ll work with the NNCP file used to configure the data plane network, which will configure the topology for each data plane network. It looks like the following ( source file ):

This YAML file defines a  NodeNetworkConfigurationPolicy for use with the NMState Operator in an OpenShift or Kubernetes environment. The policy specifies desired network configurations for nodes that match the defined nodeSelector. Here's a breakdown of the key components:

  • apiVersion : Specifies the version of the NMState API used.
  • kind : Identifies the resource type as NodeNetworkConfigurationPolicy , indicating that it's a policy for configuring network interfaces on nodes.
  • name : The name of the policy, osp-enp1s0-worker-ocp4-worker1 , uniquely identifies it within the namespace.
  • The first three are VLAN interfaces (type:  vlan ) with the names  enp1s0.20 , enp1s0.21 , and enp1s0.22 . Each interface is configured with a static IPv4 address ( 172.17.0.10/24 ,  172.18.0.10/24 , 172.19.0.10/24 , respectively) and specifies that IPv6 is disabled. DHCP is also disabled for IPv4, and each interface is brought to the up state. They are all based on the parent interface  enp1s0 and have VLAN IDs 20, 21, and 22, respectively.
  • The fourth interface configuration applies to  enp1s0 itself, setting it as an Ethernet interface (type: ethernet ) with a static IPv4 address 172.22.0.10/24 , DHCP disabled, and IPv6 disabled. The interface is also set to the up state with an MTU of 1500.
  • nodeSelector : Specifies a node's criteria for the policy to be applied. In this case, it selects a node with the hostname ocp4-worker1.aio.example.com with a worker role.

This policy aims to configure multiple VLANs on a specific worker node's enp1s0 interface in an OpenShift or Kubernetes cluster, assigning static IPv4 addresses to each VLAN and the parent interface. It effectively segregates network traffic into different VLANs for purposes such as separating internal API traffic, storage traffic, and tenant traffic, while also configuring the parent interface for another network segment. The policy targets a specific node identified by its hostname and role, ensuring that these configurations are only applied to the intended node.

NetworkAttachDefinition (NAD) file

This YAML snippet defines a  NetworkAttachmentDefinition object, part of the Kubernetes Network Custom Resource Definition (CRD) framework enabled by the Multus CNI plugin. This CRD is used to create multiple network interfaces in a Kubernetes pod. We will configure a NAD resource for each isolated network to attach a service pod to the network:

Let’s look at it: 

  • apiVersion: k8s.cni.cncf.io/v1 : Specifies the API version for the CRD. The  k8s.cni.cncf.io/v1 indicates it's related to the CNI (Container Network Interface) plug-ins managed under the CNCF (Cloud Native Computing Foundation).
  • kind: NetworkAttachmentDefinition : This tells Kubernetes that the defined resource is a  NetworkAttachmentDefinition , which Multus uses to understand how to attach secondary networks to pods.
  • name: ctlplane : The name of the NetworkAttachmentDefinition , which will be referenced by pods that want to use this network configuration.
  • namespace: openstack : Specifies the namespace where this NetworkAttachmentDefinition is created, indicating it's intended for use by pods running in the openstack namespace.
  • cniVersion : The version of the CNI specification to use.
  • name : A name for this specific network configuration.
  • type : Specifies the CNI plug-in to use, in this case, macvlan, which allows a Kubernetes pod to have a unique MAC address via a parent host interface.
  • master : The master interface on the host that the macvlan interface will be created on top of. Here, it's  ens224.4 , indicating a VLAN interface.
  • type : The type of IPAM plugin to use, here whereabouts, which supports assigning IP addresses across multiple host nodes, avoiding IP address conflicts.
  • range : The CIDR range from which IP addresses will be allocated.
  • range_start ,  range_end: Define the start and end of the IP allocation pool within the specified range.

NMState resources

As described earlier, we must define IP address pools and L2 advertisements for the NMstate Operator. We must create an IPAddressPool resource to specify the range of IP addresses MetalLB can assign to services. Let’s have a look at our  osp-ng-metal-lb-ip-address-pool . It contains several entries, one per IP address pool we define. Let’s just pick one to detail, the ctlplane one:

What do we have:

  • apiVersion: metallb.io/v1beta1 : Specifies the API version of MetalLB being used.
  • kind: IPAddressPool : Denotes the kind of Kubernetes resource. Here, IPAddressPool is a resource type provided by MetalLB for defining a pool of IP addresses.
  • namespace: metallb-system : Specifies the namespace where the resource is located. MetalLB's resources typically reside in a dedicated namespace, metallb-system , isolated from other workloads.
  • name: ctlplane : The name of the IPAddressPool resource. This name is used to identify the pool within the MetalLB configuration.
  • addresses : Lists the IP address ranges that MetalLB can allocate to LoadBalancer services.
  • - 172.22.0.80-172.22.0.90 : Defines a specific range of IP addresses (from 172.22.0.80 to 172.22.0.90 ) that MetalLB is allowed to assign. This range should be within the network subnet accessible by the cluster and not used by other devices or services to avoid IP conflicts.

As we are using MetalLB in Layer 2 mode, define an L2Advertisement resource. This tells MetalLB to advertise the IP addresses from your network's specified pool(s). 

Let’s have a look at our  osp-ng-metal-lb-l2-advertisement YAML file. It contains several entries, let’s just pick the one relevant to ctlplane :

Here's a succinct explanation of its contents:

  • apiVersion: metallb.io/v1beta1 : Specifies the version of the MetalLB API being used.
  • kind: L2Advertisement : Indicates the resource type, an L2Advertisement . This type controls how MetalLB advertises IP addresses to the local network.
  • name: ctlplane : The name of the L2Advertisement resource.
  • namespace: metallb-system : The namespace where the resource is deployed, typically MetalLB's dedicated namespace.
  • ipAddressPools : Lists the names of the IP address pools that MetalLB should advertise. In this case, it references the IPAddressPool ctlplane , which we defined earlier.
  • interfaces : Specifies which network interfaces MetalLB should use to advertise IP addresses. Here, it's configured to use the interface named  enp1s0 .

This file tells MetalLB to advertise IP addresses from the  ctlplane IP address pool over the  enp1s0 network interface, making these IP addresses reachable on the local network through standard L2 networking mechanisms (ARP for IPv4, NDP for IPv6).

Let’s regroup what we have seen so far before we keep deploying our OpenStack Control Plane. When deploying MetalLB, you first apply the MetalLB resource to install MetalLB itself. Then, you define one or more  IPAddressPool resources to specify the range of IPs MetalLB can manage. Finally, you use  L2Advertisement resources to control the advertisement of these IPs on your network in Layer 2 mode.

MetalLB and NAD ( NetworkAttachmentDefinition ) serve different purposes. MetalLB is used to expose Kubernetes services of type LoadBalancer externally, allowing them to be accessible from outside the Kubernetes cluster. It's particularly useful in bare-metal environments where you don't have a cloud provider to provision external load balancers automatically. 

NAD with Multus allows for attaching additional network interfaces to pods. This is useful in scenarios where pods need to communicate over different networks or require specific network configurations that the default Kubernetes network doesn't provide.

In essence, MetalLB simplifies external access to services, while Multus and NAD enhance pod networking capabilities within the cluster.

Data plane network configuration

The data plane network configuration file will configure the topology for each data plane network. Its YAML file contains a  NetConfig header and then various network sub-sections, each defining a network to expose to the data plane network. 

Here is an extract of this sample configuration file:

The YAML snippet defines a custom resource named  NetConfig under the API group network.openstack.org/v1beta1 . This is not a standard Kubernetes API group, which implies it's part of a specific operator that extends OpenShift functionality related to integrating OpenStack networking capabilities with Kubernetes.

Here's a breakdown of what this YAML does:

  • apiVersion: network.openstack.org/v1beta1 : Specifies the version of the API that the resource definition is compatible with. This is a custom resource definition (CRD) related to OpenStack networking under the v1beta1 version.
  • kind: NetConfig : This indicates the type of the resource. The resource is used to configure how networking should be set up within for OpenStack-managed resources within Kubernetes.
  • name: openstacknetconfig : The name of the NetConfig resource.
  • namespace: openstack : This resource is in the openstack namespace.
  • name: ctlPlane : Specifies the name of the network. It refers to a control plane network used for management and orchestration traffic in OpenStack.
  • dnsDomain: ctlplane.aio.example.com : Defines the DNS domain used for the network.
  • name: subnet1 : The name of the subnet.
  • From 172.22.0.100 to 172.22.0.120
  • From 172.22.0.150 to 172.22.0.200
  • cidr: 172.22.0.0/24 : Typically, the CIDR should match the network of the allocation ranges and the gateway.
  • gateway: 172.22.0.1 : Specifies the gateway for the subnet, which is the IP address used as the default route for traffic leaving the subnet.

From the  internalaip section, we also see we can define VLAN IDs and exclusion ranges:

  • excludeAddresses:  IP range that the data plane should not use (these are the IP addresses used by the OCP cluster compute nodes (check the NNCP section above). 
  • vlan:  VLAN ID used by the  internalapi network. The lack of this entry in the  ctlplane section denotes using a flat network.

OpenStack Control Plane deployment

Now that we have all of our networking defined, and provided we have our storage configured (the sample file we use relies on NFS, but we did not discuss it here), we can deploy the control plane.

The control plane deployment YAML defines the different OpenStack services that should be instantiated, and for each service its configuration. The file is quite long, so copying it here is difficult, but you can check a  sample file here .

Here is, from the above sample, the list of defined Services and Key Configurations (note that some services are disabled):

  • Utilizes MetalLB for LoadBalancer with an IP of 172.22.0.89.
  • Configured to use an external DNS server at 192.168.123.100.
  • Database instance named openstack , using a secret osp-secret .
  • Cinder API exposed via MetalLB with an IP of 172.17.0.80.
  • NFS backend for Cinder Volumes with specific NFS configurations.
  • Storage backend set to use Cinder with specific Glance and Cinder configurations.
  • Glance API exposed via MetalLB with an IP of 172.17.0.80.
  • Uses NFS for storage with a request of 10G.
  • Exposed via MetalLB with an IP of 172.17.0.80.
  • Uses a database instance named openstack and a secret osp-secret .
  • Enabled with storage requests set for the database and cell instances.
  • Uses a secret osp-secret .
  • Deployed with a single replica.
  • Deployed with a single replica, using a secret osp-secret .
  • API and Metadata services exposed via MetalLB with an IP of 172.17.0.80.
  • API exposed via MetalLB with an IP of 172.17.0.80.
  • Configuration for northbound and southbound DBs, as well as the OVN Controller.
  • Exposed via MetalLB with specific IPs for RabbitMQ services.
  • API and Engine exposed via MetalLB with an IP of 172.17.0.80.
  • Disabled in this configuration.
  • Ceilometer enabled, with configurations for autoscaling and metric storage.

In summary, MetalLB is extensively used to expose various OpenStack services externally via LoadBalancer type services, with annotations specifying address pools and IPs. Storage utilizes both Cinder (block storage) and NFS, with specific service configurations detailed for different services. 

Each service utilizes a specific database instance and secrets for configuration and credentials management. Replicas and scaling define the number of replicas for certain services, indicating considerations for availability and scaling. And, finally, several services specify network attachments, indicating integration with specific network configurations for service communication.

We’ll complete the deployment process in the final part of this series: Red Hat OpenShift 101 for OpenStack admins: Data plane deployment 

  • Red Hat Enterprise Linux
  • Red Hat OpenShift
  • Red Hat Ansible Automation Platform
  • See all products
  • See all technologies
  • Developer Sandbox
  • Developer Tools
  • Interactive Tutorials
  • API Catalog
  • Operators Marketplace
  • Learning Resources
  • Cheat Sheets

Communicate

  • Contact sales
  • Find a partner

Report a website issue

  • Site Status Dashboard
  • Report a security problem

RED HAT DEVELOPER

Build here. Go anywhere.

We serve the builders. The problem solvers who create careers with code.

Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

Red Hat legal and privacy links

  • About Red Hat
  • Contact Red Hat
  • Red Hat Blog
  • Diversity, equity, and inclusion
  • Cool Stuff Store
  • Red Hat Summit
  • Privacy statement
  • Terms of use
  • All policies and guidelines
  • Digital accessibility

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.

Q&A for work

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

What is the option "host-name" for in /etc/dhcp/dhcpd.conf?

I setup my ubuntu as DHCP server and specified some fixed IP addresses for certain devices using the syntax:

host client1 { hardware ethernet b8:27:eb:ce:02:83; fixed-address 192.168.1.1; option host-name "client1"; }

Now it seems that the correct IP addresses are given to the clients, but I cannot access the clients over ssh using

I am very new to networking and I am wondering, what is the host-name for if not for accesing the IP address? Is there a mistake in my config file or is it really not possible to use the hostname on the server for ssh connection to the client (instead of ip)? Thanks

Camill Trüeb's user avatar

  • can you see a problem at this line fixed addreess 192.168.1.1 –  cmak.fr May 21, 2019 at 6:48
  • Sorry for the typos! I corrected the code. But thank you for your answer, it solves my confusion very well. Since the option host-name was included in many examples I found online, I found it hard to believe that that it would be ignore by most of the clients. –  Camill Trüeb May 21, 2019 at 9:05

The host-name option is used to tell the client host to take this specified host-name An option host-name statement within a host declaration will override the use of the name in the host declaration. But, as the man dhcpd.conf says: It should be noted here that most DHCP clients completely ignore the host-name option sent by the DHCP server, and there is no way to configure them not to do this. So you generally have a choice of either not having any hostname to client IP address mapping that the client will recognize, or doing DNS updates. It is beyond the scope of this document to describe how to make this determination. For more insformation: - How to get the hostname from a DHCP server - https://www.isc.org/wp-content/uploads/2017/08/dhcp41conf.html

cmak.fr's user avatar

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged server dhcp hostname client ..

  • The Overflow Blog
  • OverflowAI and the holy grail of search
  • Featured on Meta
  • Our Partnership with OpenAI
  • What deliverables would you like to see out of a working group?

Hot Network Questions

  • Calculating sample size for comparing pretest and post-test scores
  • Can you switch your "Replicate Magic Item" Infusion after a long rest?
  • If coNP ⊆ NP, does that mean coNP = NP?
  • Is spin a fundamental property of QFT?
  • Karatsuba algorithm in C
  • What is this "/|\" symbol on the enclosures of various appliances?
  • I got hit with a spell carrying "Personal fireball thrower". How long will I throw fireballs everywhere?
  • Why does classical physics not predict particles in the double-slit experiment to land in just two different locations?
  • Director forcing an all day meeting on an off day before a holiday
  • Compute the degree of a string
  • Do native speakers say "I'm [keen on/fond of] cloudy days"?
  • What species would make good flying livestock?
  • I missed a paper from the past year which is very close to what I am doing. What should I do?
  • Vrock spores question
  • Definition of free fall in GR
  • How to store private keys on flashdrive
  • How would time dilate for pioneers travelling to Alpha Centauri Cb?
  • What is the specific term for countries without direct access to the high seas?
  • Is there a single word (or a short phrase) meaning "to be used both in the UK and in the US"
  • A generalization of derangement number
  • Spacing and vertical lines on a tabularx
  • Bimatrix Game: Nash Equilibrium and Safety Levels
  • Was the purported 1968 standard for encoding ASCII on punched cards ever used?
  • ConTeXt equivalent for \textcommabelow (e.g. a t-comma)

can dhcp assign hostname

IMAGES

  1. What is Dynamic Host Configuration Protocol (DHCP) and How it Works

    can dhcp assign hostname

  2. DHCP Server : Functions And How It Works

    can dhcp assign hostname

  3. Understanding DHCP: The Dynamic Host Configuration Protocol

    can dhcp assign hostname

  4. Configure hostname via DHCP

    can dhcp assign hostname

  5. Tutorial Konfigurasi Ip Address Dhcp Server Dns Server Dan Ntp

    can dhcp assign hostname

  6. What is DHCP (Dynamic Host Configuration Protocol)?

    can dhcp assign hostname

VIDEO

  1. Edit, Delete & Add Network connection form terminal and set Hostname in RHEL7 / CentOS7

  2. How to Configure DHCP Server & DHCP Client

  3. Introducing Port Based DHCP

  4. What is DHCP

  5. Free CCNA In Hindi

  6. What is DHCP Dynamic Host Configuration Protocol

COMMENTS

  1. windows

    1. In the Windows DHCP admin tool, right-click on the server and select Properties. Go to the DNS tab and "Enable DNS Dynamic Updates". This is the default setting, though (I'm pretty sure), and if it's turned off, it's likely that someone turned it off for a reason. And that reason is probably to prevent it from crapping all over your DNS server.

  2. How can I configure the hostnames of my servers from services on the

    "Network configuration" here primarily means DHCP. Usually the DHCP client reports its own current hostname and the DHCP server only collects them, but the server can include a different hostname that it wants the client to use instead. If the client receives a new hostname via DHCP, that becomes the "transient" hostname aka the kernel hostname.

  3. dns

    With ISC's DHCP server, which is freeware and included in most Linux distributions, you can create a setup with a filter list that allows only clients sending specific option 12 values (hostname option) and denies the rest. However, there is absolutely no security around this. Anybody who finds out what hostname's are allowed can rename their ...

  4. Configure hostname via DHCP

    Right-click the DHCP lease, and then select Add to Reservation. In the left pane, select the Reservations in the scope where the device has a DHCP lease. Right-click the Reservations, and then click Configure Options. Select option 012 Host Name and enter the name of the device in the Data entry field.

  5. Dhcp Client: What is the difference between client sending the hostname

    You can have DHCP server that has a database of MAC addresses, and sends back the hostname based on the MAC address, so you don't need to configure the hostname on your clients. Or it may use a numbered hostname scheme, and assign this client an unused one. Great if you need to administer hundreds of machines.

  6. Configure hostname via DHCP

    Right-click the DHCP lease, and then select Add to Reservation. In the left pane, select the Reservations in the scope where the device has a DHCP lease. Right-click the Reservations, and then click Configure Options. Select option 012 Host Name and enter the name of the device in the Data entry field.

  7. How do I assign a hostname to a dynamic IP address assigned by DHCP?

    Say I put a host wordpress.Jonathan-Linux.local, which I would use wordpress.org on. And ftp.Jonathan-Linux.local. I want remote access to those domains. On Windows, the NetBIOS name and the DNS suffix for that NetBIOS domain, is found remotely, even when the IP address automatially changes by DHCP.

  8. Static and dynamic IP address configurations for DHCP

    This two-part article series covers static and dynamic IP address settings and the configuration of a DHCP server. This article (part one) defines network identities, contrasts static and dynamic configurations, and covers the commands needed to manage the settings. Part two covers the deployment of a DHCP server, DHCP scope configuration, and ...

  9. Dynamic Host Configuration Protocol

    The Dynamic Host Configuration Protocol (DHCP) is a network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other communication parameters to devices connected to the network using a client-server architecture.. The technology eliminates the need for individually configuring network devices manually, and consists of two network ...

  10. What is the difference between "Change hostname via DHCP" versus

    To disable using DHCP to get an IP address uncheck Change Hostname via DHCP. Assign Hostname to Loopback IP associates your hostname with 127.0.0.2 (loopback) IP address in /etc/hosts. This is an useful option if you want to have the hostname resolvable at all times, even without active network. Knowing that it can be distilled like this:

  11. 14.2. Configuring a DHCP Server

    Note that you can also use the optional parameter host-name to assign a host name to the client. Example 14.3. Static IP Address Using DHCP. ... The other network card can be used as a DHCP server for the internal network behind the firewall. Specifying only the network card connected to the internal network makes the system more secure because ...

  12. Step-by-Step: Configure DHCP Using Policy-based Assignment

    Option assignment. A DHCP client uses the parameter request list field in a DHCP packet to request a list of standard options from the server. The option assignment processing for a client is similar to that of IP address assignment. The DHCP server evaluates the fields in the client request against each policy applicable for the scope in the ...

  13. [LAN] How to set up DHCP Server on ASUS Router?

    Go to LAN > " DHCP Server " tab. Function description. (1) Enable the DHCP Server. Enable the DHCP server function to allow the router's DHCP server to automatically assign IP addresses to network clients. If this function is disabled, you'll need to assign the IP address for your LAN devices manually. (2) You can name your router for clients ...

  14. Configuring Linux Static DHCP Clients by Sending Host Name

    Q. My DHCP server configured to assign static IPs to few Debian / Ubuntu Linux boxes using hostnames. My Windows 2000 and XP client computer sends hostname automatically. How do I send my hostname under Linux using dhcp client? A. By default, the DHCP server requests the subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers and host-name […]

  15. How to get the hostname from a DHCP server

    Replace eth0 and wlan0 with the names of the interfaces from which you want to obtain the hostname. In most cases eth0 and wlan0 should stay the same. Make sure it is readable... chmod a+r /etc/dhcp/dhclient-exit-hooks.d/hostname. That's all. On the next dhcp response your hostname will update automatically.

  16. How to edit Wi-Fi router DHCP clients name?

    For android devices, go to Settings > About your phone > Edit the hostname there. For windows computers/laptops, @kreemoweet has shown a way. Just you have to do a restart after completing the steps. The router admin page shows the friendly host names of the DHCP clients (devices connected). Share. Improve this answer.

  17. How to Set Up Static DHCP So Your Computer's IP Address ...

    Here, my range of IPs would be 192.168.1.100 - 192.168.1.114. Now, click on the Services tab up top. Under the DHCP Server section, you can see that there's a list of "Static Leases" click on the Add button to add a new one. Enter the MAC address of each computer, give each one a name so you know which is which, and then assign them an ...

  18. How to set hostnames to specific range of IP addresses on DHCP Server

    My professor answered my question. There is no specific tool or method to assign hostname and ip address pair without knowing MAC address in Linux Server. Because Linux server uses pure DHCP standards. So I have to assign a hostname/fixed ip address with MAC address for each slave in /etc/dhcp/dhcpd.conf file. For example:

  19. Red Hat OpenShift 101 for OpenStack admins: Configuration

    In this case, it selects a node with the hostname ocp4-worker1.aio.example.com with a worker role. This policy aims to configure multiple VLANs on a specific worker node's enp1s0 interface in an OpenShift or Kubernetes cluster, assigning static IPv4 addresses to each VLAN and the parent interface. It effectively segregates network traffic into ...

  20. What is the option "host-name" for in /etc/dhcp/dhcpd.conf?

    The host-name option is used to tell the client host to take this specified host-name. An option host-name statement within a host declaration will override the use of the name in the host declaration. But, as the man dhcpd.conf says: It should be noted here that most DHCP clients completely ignore the host-name option sent by the DHCP server ...