Ask Your Question

how neutron dhcp allocates ip

asked 2017-05-30 02:48:56 -0500

br gravatar image

I have gone through the follwoing article to understand how vm will get ip?

Step7: Following the request to create a new port, Neutron service creates a new port. It is important to recollect that a port, in our context, means a pair of MAC and IP address. Not only does neutron creates these, it also persists them in neutron database. Now our VM has an IP address and the virtual NIC of the VM has a MAC address.

Step8: The neutron service sends a RPC message to the DHCP agent on the network node to notify the DHCP agent about the newly created VM and the IP and MAC it is associated with. The DHCP agent updates its internal files so that next time it receives request for IP address from same VM it can get it out accurately.

I got little bit confused about ip allocation.

I was having the understanding dhcp agent is responsible to allocate the ip but step 7 says neutron service allocates the ip and in step 8, its just notifies the dhcp agent to update the internal files about the ip.

please clarify me and explain little bit more about dnsmasq involvement in the procedure of allocation of ip?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2017-05-30 07:05:44 -0500

Neutron allocates IP and MAC addresses and tells the DHCP server to provide this IP address when it receives a DHCP request from that MAC address. In other words, the article is correct, although small details may differ depending on how the cloud was deployed and configured.

Usually, the DHCP server is implemented by dnsmasq. The article says that dnsmasq runs on the network node, but it can be located elsewhere. Often, several dnsmasq processes running on different nodes serve the same network, which provides some HA.

dnsmasq doesn't allocate the addresses, it just updates its config files according to the addresses allocated by Neutron.

edit flag offensive delete link more


Hi Berned Bausch, Thanks for your explanation. I have few doubts. 1. As per networking fundamentals, DHCP server allocates the ip. If neutron allocates the ip and mac addresses then what's the purpose of DHCP server, is it only provide the ip address which is allocated by neutron to the dhcp request

br gravatar imagebr ( 2017-05-30 09:11:18 -0500 )edit

where dhcp client is running? I didn't come across dhcp client, you meant to say dhcp agent?

br gravatar imagebr ( 2017-05-30 09:19:59 -0500 )edit

The DHCP client runs on the instance. Regarding your other question, the purpose of the DHCP server is indeed to send the IP address to the instance when it asks for it.

Bernd Bausch gravatar imageBernd Bausch ( 2017-05-30 11:30:13 -0500 )edit

@Bernd, How neutron allocates the ip address without utilizing the dhcp-server(dnsmasq)?

br gravatar imagebr ( 2017-06-10 11:59:12 -0500 )edit

Why do you think DHCP is required to allocate addresses? Neutron manages the address pool and tracks which addresses are in use. When a request to create or update a port comes in, Neutron associates the next free address with the port.

DHCP is only a method to inform the instance of its address.

Bernd Bausch gravatar imageBernd Bausch ( 2017-06-10 19:30:58 -0500 )edit

answered 2019-01-23 12:27:51 -0500

vgdub gravatar image

May be anyone who were able to solve the issue can update the below thread , because in my kilo network this recently started and I am not sure what is literally causing this. I would appreciate the help.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-05-30 02:48:56 -0500

Seen: 1,331 times

Last updated: Jan 23