Score:1

Linux, how to ask DHCP to assign a specific IP address

cn flag

I've recently purchased a tiny PC, on which I want to install Proxmox VE. Currently I don't have any access to my landlord's router, therefore I don't know how big current DHCP pool is (and if there're some IPs excluded from the pool).

Is it possible to ask to the DHCP server for one or more specific IP address of my choice to keep that one forever?

Nikita Kipriyanov avatar
za flag
Are you searching for a recipe to circumvent Proxmox VE requirement to have an IP statically configured?
in flag
Talk to your landlord.
mlazzarotto91 avatar
cn flag
@MarkWagner isc-dhclient-4.4.1
vn flag
What DHCP client are you using?
Score:1
it flag

posting a section of debian man page for dhclient.conf :

fixed-address ip-address;

       The  fixed-address  statement is used
       to set the ip address of a particular
       lease.   This  is  required  for  all
       lease  statements.   The  IP  address
       must  be  specified  as a dotted quad
       (e.g., 12.34.56.78).

so by modifying /etc/dhclient.conf you should be able to request a fixed IP if the dhcp server doesn't reject such request.

Score:-2
cn flag

there is not a way to "ask" the DHCP server for a specific address.

this IS a way for the DHCP server to be configured to reserve a specific address for a specific computer (by MAC address usually).

depending on where your DHCP server is the way to do the reservation will be different.

Nikita Kipriyanov avatar
za flag
This is wrong. [RFC2131 section 3.1](https://datatracker.ietf.org/doc/html/rfc2131#section-3.1) says: "*The DHCPDISCOVER message MAY include options that suggest values for the network address and lease duration.*" This is precisely the way built into the protocol how to request a particular IP address from a DHCP server. The client is supposed to do this every time, to possibly have the same address again ([4.3.1](https://datatracker.ietf.org/doc/html/rfc2131#section-4.3.1)), but the server may refuse (NAK). The question was how to make use of this with the Debian network configuration.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.