LinuxQuestions.org
Help answer threads with 0 replies.
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 09-15-2004, 09:18 AM   #1
dgreenbean
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 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.

Any help will be extremely appreciated.

Thanks,
David
 
Old 09-15-2004, 09:33 AM   #2
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 602

Rep: Reputation: 49
So don't get the address from DHCP but set it statically on this server.
 
Old 09-15-2004, 09:40 AM   #3
dgreenbean
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?

Thanks,
David
 
Old 09-15-2004, 11:30 AM   #4
linux_newbie_23
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
dgreenbean
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
reetep
Member
 
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
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
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
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,897

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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
linux_newbie_23
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
dgreenbean
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,
David
 
  


Reply


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


All times are GMT -5. The time now is 05:11 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration