Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.