Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-13-2006, 03:41 PM   #1
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,192

Rep: Reputation: 339Reputation: 339Reputation: 339Reputation: 339
Question: Request a specific IP address from a DHCP server?

Is there a way (even a kludge) to request a specific IP address from a DHCP server? (assuming the desired IP address is currently free and available)

I'm running Debian Sarge using dhclient from the dhcp-client package (version 2.0pl5-19.1sarge2)

There is not any "release" option (-r) on my dhclient although this option is documented on some sites when you run a Google search on "dhclient release". I was thinking if I could somehow force a release of my current IP, hack my /var/run/dhcpclient.leases file with my desired IP address, then ifdown/ifup might do the trick.

If anyone is wondering why in the world I would want to do this, it's because at work my IP address has been very stable historically, even though it's DHCP. To ssh into my home server I have it setup (at home, in my authorized_keys2 file) that I must use pubkey authentication from a specific IP address. In retrospect, this might be a tad too tight given my once stable work IP address is now changing on me. I will loosen up that specific IP address requirement when I get home so this doesn't happen to me again.

My old IP address, the one currently configured at home in authorized_keys2, appears to be unused here at work as best I can tell (Why didn't the work DHCP server reassign me my old address at lease renewal? Maybe it was rebooted and lost it's memory.) Anyway, I was speculating on how I might regain my old IP address. Hacking my leases file and running ipdown/ifup doesn't work. I'm sure the work DHCP server has my MAC address tied into the IP address that it's reassigning to me over and over.

p.s. - I do have a second public key that can access my home server from any incoming IP address. That's only stored on a thumbdrive. Which happens to be, ahem, sitting on my desk at home and not in my pocket at the moment!
Old 09-13-2006, 04:25 PM   #2
LQ Guru
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
Do you manage the DHCP server at work ?

If so you can reserve a specific IP on the DHCP server that is related to the MAC address of the workstation requesting the lease..

any time the DHCP server sees a request for an address from your MAC address it will alwayts assign the same IP
Old 09-13-2006, 04:32 PM   #3
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,192

Original Poster
Rep: Reputation: 339Reputation: 339Reputation: 339Reputation: 339
Originally Posted by farslayer
Do you manage the DHCP server at work ?
No I don't.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To know if a host configured with DHCP has obtained IP address from DHCP server? Prassanta SUSE / openSUSE 1 06-29-2006 09:48 AM
Need help getting dhcp client request to server. Budious Linux - Networking 0 03-26-2006 06:54 PM
how to request a specific ip address with dhclient hypexr Linux - Networking 4 09-15-2005 10:07 PM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
obtaining a specific ip address from DHCP true_atlantis Slackware 5 09-28-2004 12:12 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:34 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration