Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 09-15-2004, 09:18 AM   #1
LQ Newbie
Registered: Sep 2004
Posts: 4

Rep: Reputation: 0
Fixed IP Address with DHCP

Hi there,

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 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";

After restarting the network service and rebooting the machine, all I got was (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.

Any help will be extremely appreciated.

Old 09-15-2004, 09:33 AM   #2
Registered: Aug 2004
Location: Europe
Posts: 608

Rep: Reputation: 50
So don't get the address from DHCP but set it statically on this server.
Old 09-15-2004, 09:40 AM   #3
LQ Newbie
Registered: Sep 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks for your reply.

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?

Old 09-15-2004, 11:30 AM   #4
LQ Newbie
Registered: Sep 2004
Posts: 17

Rep: Reputation: 0
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.
Old 09-15-2004, 11:41 AM   #5
LQ Newbie
Registered: Sep 2004
Posts: 4

Original Poster
Rep: Reputation: 0
RH9 uses dhclient. I actually used those man pages to create the dhclient-eth0.conf mentioned in the initial post.

I fear that the conf file either isn't being read or that there is something blocking the fixed-address property from being processed.

Thank you for your reply, but it seems that there is something more complex at work here.
Old 09-15-2004, 03:52 PM   #6
Registered: Oct 2003
Location: UK
Distribution: Debian
Posts: 122

Rep: Reputation: 15
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.
Old 09-15-2004, 05:20 PM   #7
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
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?
Old 09-15-2004, 09:17 PM   #8
Registered: Aug 2002
Posts: 16,963

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
I do not believe that the router will not send traffic if a PC is not assigned an IP address via DHCP. What is the make and model of the router?
Old 09-15-2004, 10:00 PM   #9
LQ Newbie
Registered: Sep 2004
Posts: 17

Rep: Reputation: 0
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.
Old 09-19-2004, 01:12 PM   #10
LQ Newbie
Registered: Sep 2004
Posts: 4

Original Poster
Rep: Reputation: 0
Hi all,

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.

Thanks again,


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
DHCP: Problem in assigning fixed address to clients libregeek Linux - Networking 6 11-17-2005 11:59 PM
i need fixed IP address. bruse Linux - Networking 5 09-19-2005 06:27 AM
dhcp no ip address and netmask dont match route address pengy666 Linux - Wireless Networking 1 05-08-2005 09:33 AM
DHCP with fixed IPs alithenake Slackware 4 03-18-2005 09:02 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:14 AM.

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