LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-09-2012, 09:35 AM   #1
ubuntuv
Member
 
Registered: Jan 2010
Posts: 82

Rep: Reputation: 0
dhclient command to request a specific ip address


hi,

I am using fedora core 11. I want my machine to ask the dhcp server a specific IP address. Suppose it got earlier 1.1.1.2, after releasing the ip address using 'dhclient -r XX' command, it has to again request for IP address '1.1.1.2'.

I have seen in 'man dhclient' that by using -lf command we can specify the lease file directory. Can someone help me in creating a file with this IP address and issue it.

Thanks in advance.
uv.
 
Old 03-09-2012, 11:49 AM   #2
njlinuxmike
LQ Newbie
 
Registered: Feb 2012
Posts: 9

Rep: Reputation: Disabled
I dont know the answer you are looking for. But, you can have the server assign the same address every time to the same NIC. All you have to do is tell the dhcp server to assign the desired address to the MAC address of the client NIC. Its still DHCP and the same address every time and you only have to configure the server, not each client you what to do it to.

Cheers

Mike
 
Old 03-12-2012, 11:36 AM   #3
verigoth
Member
 
Registered: May 2002
Posts: 179

Rep: Reputation: Disabled
The lease file directory is where it stores information pertaining to current and former leases, not a place where it searches for any sort of configuration. What you are describing is in fact the behavior of virtually every dhcp client I have ever seen. The only time you will get a different IP is if some other client connected between your release and reconnection and was given that specific IP, or if the server intentionally assigns you a different IP (some ISPs pull this trick to keep you "protected" from external access). As was previously stated you need to configure the server for what is called static dhcp if you want to ensure the client will always get the same IP (or just use a static address outside of the dhcp pool). Otherwise if you're asking because you want to get the same IP from your ISP I'm afraid there's not much you can do about it besides using some sort of dynamic DNS service.
 
Old 03-12-2012, 12:07 PM   #4
ubuntuv
Member
 
Registered: Jan 2010
Posts: 82

Original Poster
Rep: Reputation: 0
Thanks for the replies. Presently, I have no control over the DHCP server. I want to somehow make a request to DHCP server, so that it asks for some set of IP addresses. Any one from the list is OK for me.

--uv.
 
Old 03-12-2012, 03:38 PM   #5
verigoth
Member
 
Registered: May 2002
Posts: 179

Rep: Reputation: Disabled
Apparently dhcpcd can do this (I am wrong from time to time). The command is dhcpcd -s xxx.xxx.xxx.xxx. Note that this does not mean you will get that specific IP, and the default if not specified is the previous IP it was assigned. If you want to do it your way I would suggest you write a script to ask for one IP, check to see if you get it and exit, or release the IP and try the next in the list. It will probably take a lot longer to get an IP though. What the process would be in your interface/configuration files on FC would be is beyond me.
 
  


Reply



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
dhclient 'flaw'; request for info salasi Linux - Security 5 04-12-2011 01:50 PM
Question: Request a specific IP address from a DHCP server? haertig Linux - Software 2 09-13-2006 04:32 PM
how to request a specific ip address with dhclient hypexr Linux - Networking 4 09-15-2005 10:07 PM
Broadcast request for dhclient virendratp Linux - Networking 1 08-05-2004 01:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:56 PM.

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