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'm somewhat of a newbie trying to set up a Linux (RH9) box on a LAN that I have set up. The Linux machine is going to be a web server behind a firewall controlled by a router (similar to a DLink router).
The issue is that I want the Linux machine to always try to get the same IP from the DHCP on the router, say 192.168.1.150. I will never have more than 20 machines on the LAN, so this shouldn't conflict with anything, but if it does, I can change the address. The problem is that I can't configure the DHCP server on the router to assign that IP address to a hardware address.
Also, since I want the Linux box to be a web server, I need for the router to send traffic on port 80, which it will only do if it assigns the IP address using DHCP (it's very picky).
I tried creating /etc/dhclient-eth0.conf and putting this in it:
lease {
interface "eth0";
fixed-address 192.168.1.150;
}
After restarting the network service and rebooting the machine, all I got was 192.168.1.101 (dynamically assigned by DHCP).
What bothers me even more is that I had done this successfully at one point, but completely forgot how I did it, other than the dhclient.conf file above.
Does anyone have an idea of what I missed?
By the way, if I run `dhclient -1 -q -cf /etc/dhclient-eth0.conf eth0`, the same thing happens.
Unfortunately I had tried that. When I statically set the address, the router would no longer route port 80 to it. The router requires that the machine asks for a DHCP lease from it.
I think there's a way to configure the DHCP client to ask for a specific address from the DHCP server. Do you know if this is possible?
I forget what DHCP client RH9 uses. If it's "dhclient"
say "man dhclient" (and if it's "pump" say "man pump"
etc.). If it's dhclient you can also say "man dhclient.conf"
to get information about its configuration file.
Does the manufacturer of your router not provide you with documentation? I would have thought you want to ask the DHCP server to hand out the same IP address based on the hardware address.
If you select a static address below the starting address for DHCP, you may be able to route port 80 to it. Isn't there a page where you can enter the last ip number for the machine receiving that port?
I can't say I understood most (any?) of what I read, but "man dhclient-script"
mentions the "BOUND" variable, which seems to say to me that a client could
request a particullar address, what you originally asked about. Let us know
if it works. Thanks.
Thank you for your replies. In the end, I switched to a Linksys router, and used a static IP address. It bugs me that I couldn't do it with the other router, BritePort 8120, but such is life. I wouldn't be surprised if they have a firmware upgrade for that router.
I guess my hack from before will remain a mystery for now.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.