Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure DHCP Services

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you how to configure DHCP services, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.

Instance can get IP from Neutron's DHCP service during startup, and we will discuss its internal implementation mechanism in detail.

The component of Neutron that provides DHCP services is DHCP agent. DHCP agent implements the DHCP function through dnsmasq by default when the network node is running.

Configure DHCP agent

The configuration file for DHCP agent is located in / etc/neutron/dhcp_agent.ini.

Dhcp_driver

Use dnsmasq to implement DHCP.

Interface_driver

Use linux bridge to connect to the DHCP namespace interface.

When you create a network and enable DHCP on the subnet, the DHCP agent on the network node starts a dnsmasq process to provide DHCP services to the network.

Dnsmasq is an open source software that provides DHCP and DNS services. There is an one-to-one relationship between dnsmasq and network, and a dnsmasq process can provide services for all subnet with enable DHCP in the same netowrk.

Going back to our experimental environment, we created flat_net and enabled DHCP on subnet. Execute ps to view the dnsmasq process, as shown in the following figure:

DHCP agent creates a directory / opt/stack/data/neutron/dhcp/, for each network to hold the dnsmasq configuration file for that network.

The important startup parameters of dnsmasq are discussed below:

-- dhcp-hostsfile

The file that stores the DHCP host information, and the host here is actually instance. Dnsmasq gets the correspondence between host's IP and MAC from this file. Each host corresponds to an entry, and the information comes from the Neutron database.

For flat_net,hostsfile is / opt/stack/data/neutron/dhcp/f153b42f-c3a1-4b6c-8865-c09b5b2aa274/host, interface information for DHCP,cirros-vm1 and cirros-vm2 is recorded.

-- interface

Specifies the interface that provides the DHCP service. Dnsmasq listens for instance's DHCP requests on this interface.

For flat_net,interface it is ns-19a0ed3d-fe. As you may recall, the DHCP interface we saw earlier is called tap19a0ed3d-fe (shown in the following figure), not ns-19a0ed3d-fe.

The above is how to configure DHCP services. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report