Networking Forums

Networking Forums > Computer Networking > Linux Networking > Linux DHCP server with dynamic IP

Reply
Thread Tools Display Modes

Linux DHCP server with dynamic IP

 
 
Iceman
Guest
Posts: n/a

 
      10-24-2004, 09:54 PM
I wanted to setup a small "network" (2 PCs), with SuSE Linux 8.1 on
one and WinXP Pro/SP2 on another. Simple without DHCP, but I wanted
DHCP.

The problem is that I need to assign a static IP to my DHCP server on
SuSE. It's not a problem to do it, but is there a solution for this:
- eth0 doesn't have IP
- eth0 asks DHCP for it's IP
- DHCP sees that eth0 doesn't have IP, automatically assigns it
(something like in Windows automatic IP assignment) and returns it.

The scenario could be:
- DHCP starts and looks for any broadcast network cards
- It finds eth0, but it has no IP
- Brings it up and automatically gives an IP.

Unfortunately, the current scenario is:
No subnet declaration for eth0 (0.0.0.0)
** Ignoring requests on eth0 ....

Not configured to listen on any interfaces.

Any suggestions? Thanks in advance!
 
Reply With Quote
 
 
 
 
Davide Bianchi
Guest
Posts: n/a

 
      10-25-2004, 05:05 AM
On 2004-10-24, Iceman <(E-Mail Removed)> wrote:
> - eth0 doesn't have IP
> - eth0 asks DHCP for it's IP


You need to have a static IP _before_ the dhcp sever starts.
otherwise it won't be able to serve any IP.

Davide

--
Managers are those lusers who can tell you what to do and you
kinda[3] have to listen. [3] I mean "kinda" in the "not really,
in fact, not at all" mode. --Chris Saunderson
 
Reply With Quote
 
Andrew Schulman
Guest
Posts: n/a

 
      10-25-2004, 08:46 AM
> I wanted to setup a small "network" (2 PCs), with SuSE Linux 8.1 on
> one and WinXP Pro/SP2 on another. Simple without DHCP, but I wanted
> DHCP.
>
> The problem is that I need to assign a static IP to my DHCP server on
> SuSE. It's not a problem to do it, but is there a solution for this:
> - eth0 doesn't have IP
> - eth0 asks DHCP for it's IP
> - DHCP sees that eth0 doesn't have IP, automatically assigns it
> (something like in Windows automatic IP assignment) and returns it.
>
> The scenario could be:
> - DHCP starts and looks for any broadcast network cards
> - It finds eth0, but it has no IP
> - Brings it up and automatically gives an IP.


I'm not sure if I completely understand your question, but I think what you
want is to use DHCP, but always end up with the same IP. If that's what
you want, look at dnsmasq. It's a cacheing DNS forwarder and DHCP server,
well-suited for small LANs. In its configuration file you can specify

dhcp-host=<MAC>,<IP>

and dnsmasq will always assign that IP address, by DHCP, to the NIC with the
given MAC.

Good luck,
Andrew.

--
To reply by email, replace "deadspam.com" by "alumni.utexas.net"

 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      10-25-2004, 09:54 PM
In article <(E-Mail Removed) >, Iceman wrote:

>I wanted to setup a small "network" (2 PCs), with SuSE Linux 8.1 on
>one and WinXP Pro/SP2 on another. Simple without DHCP, but I wanted
>DHCP.


Why? DHCP and it's predecessor BOOTP were developed for use in situations
where there were more computers than available IP addresses. You can use
any /24 and have room for one hundred times as many computers as you have
IPs.

>The problem is that I need to assign a static IP to my DHCP server on
>SuSE.


Yes - that is how the protocol works.

>It's not a problem to do it, but is there a solution for this:
>- eth0 doesn't have IP
>- eth0 asks DHCP for it's IP
>- DHCP sees that eth0 doesn't have IP, automatically assigns it
>(something like in Windows automatic IP assignment) and returns it.


0951 Bootstrap Protocol. W.J. Croft, J. Gilmore. Sep-01-1985. (Format:
TXT=28354 bytes) (Updated by RFC1395, RFC1497, RFC1532, RFC1542)
(Status: DRAFT STANDARD)

1395 BOOTP Vendor Information Extensions. J. Reynolds. January 1993.
(Format: TXT=16314 bytes) (Obsoletes RFC1084, RFC1048) (Obsoleted by
RFC1497, RFC1533) (Updates RFC0951) (Status: DRAFT STANDARD)

1497 BOOTP Vendor Information Extensions. J. Reynolds. August 1993.
(Format: TXT=16805 bytes) (Obsoletes RFC1395, RFC1084, RFC1048)
(Obsoleted by RFC1533) (Updates RFC0951) (Status: DRAFT STANDARD)

1532 Clarifications and Extensions for the Bootstrap Protocol. W.
Wimer. October 1993. (Format: TXT=51545 bytes) (Obsoleted by RFC1542)
(Updates RFC0951) (Status: PROPOSED STANDARD)

1533 DHCP Options and BOOTP Vendor Extensions. S. Alexander, R. Droms.
October 1993. (Format: TXT=50919 bytes) (Obsoletes RFC1497, RFC1395,
RFC1084, RFC1048) (Obsoleted by RFC2132) (Status: PROPOSED STANDARD)

1542 Clarifications and Extensions for the Bootstrap Protocol. W.
Wimer. October 1993. (Format: TXT=52948 bytes) (Obsoletes RFC1532)
(Updates RFC0951) (Status: DRAFT STANDARD)

2132 DHCP Options and BOOTP Vendor Extensions. S. Alexander, R. Droms.
March 1997. (Format: TXT=63670 bytes) (Obsoletes RFC1533) (Updated by
RFC3442) (Status: DRAFT STANDARD)

3442 The Classless Static Route Option for Dynamic Host Configuration
Protocol (DHCP) version 4. T. Lemon, S. Cheshire, B. Volz. December
2002. (Format: TXT=19370 bytes) (Updates RFC2132) (Status: PROPOSED
STANDARD)

You can get all of those documents on the web. Try

http://www.ietf.org/rfc/rfc0000.txt
http://www.faqs.org/rfcs/rfc0000.html
http://www.rfc-editor.org/rfc/rfc0000.txt
http://www.ccd.bnl.gov/network/general/rfc0000.html
http://www.cis.ohio-state.edu/htbin/rfc/rfc0000.html

replacing the zeros with the _four_ digit number of each one. You have a
bit of reading to do. You also may notice the dates on these documents.
This concept goes back long before microsoft invented networks.

>The scenario could be:
>- DHCP starts and looks for any broadcast network cards
>- It finds eth0, but it has no IP
>- Brings it up and automatically gives an IP.


System doesn't work that way. Read the boot scripts.

>Any suggestions? Thanks in advance!


Use static addresses and avoid all the problems. You have two lousy
computers - there is no need for DHCP. For jollies, read the thread in
this newsgroup titled "checking if a MAC address exist in a LAN and which
is the attached IP address" and see the obvious security nightmare another
user is having. See the thread "RP-PPPoE assigns a new IP address every
time I reboot!" for more problems.

Old guy

 
Reply With Quote
 
Andrew Schulman
Guest
Posts: n/a

 
      10-25-2004, 11:33 PM
> You have two lousy
> computers - there is no need for DHCP.


There is at least one good reason for using DHCP even in such a situation:
if one of the hosts is a laptop that may want to travel and connect to
other networks, then it makes sense to configure it to get its IP address
by DHCP. That's why I use DHCP in my small home LAN. In fact the IP
addresses are fixed, because that's the way I've configured my DHCP server;
but the hosts still use DHCP to get their addresses.

--
To reply by email, replace "deadspam.com" by "alumni.utexas.net"

 
Reply With Quote
 
James Knott
Guest
Posts: n/a

 
      10-26-2004, 02:19 AM
Andrew Schulman wrote:

>> You have two lousy
>> computers - there is no need for DHCP.

>
> There is at least one good reason for using DHCP even in such a situation:
> if one of the hosts is a laptop that may want to travel and connect to
> other networks, then it makes sense to configure it to get its IP address
> by DHCP. That's why I use DHCP in my small home LAN. In fact the IP
> addresses are fixed, because that's the way I've configured my DHCP
> server; but the hosts still use DHCP to get their addresses.
>


I use static IPs on my home network. On my ThinkPad, I have Linux
configured to come up in static, but I can switch to another profile,
which runs dhcp. On the XP side, it's configured to try dhcp first and if
that fails default to a static address, which I use on my home network.

--

(This space intentionally left blank)
 
Reply With Quote
 
Andrew Schulman
Guest
Posts: n/a

 
      10-26-2004, 05:01 PM
> I use static IPs on my home network. On my ThinkPad, I have Linux
> configured to come up in static, but I can switch to another profile,
> which runs dhcp. On the XP side, it's configured to try dhcp first and if
> that fails default to a static address, which I use on my home network.


What tool do you use to quickly change network profiles in Linux?

In XP, do you get the fallback-to-static IP address from [connection] ->
Properties -> General -> Internet Protocol (TCP/IP) -> Properties ->
Alternate Configuration -> User configured? If not, then where?

Thanks, A.

--
To reply by email, change "deadspam.com" to "alumni.utexas.net"
 
Reply With Quote
 
James Knott
Guest
Posts: n/a

 
      10-26-2004, 06:14 PM
Andrew Schulman wrote:

>> I use static IPs on my home network. On my ThinkPad, I have Linux
>> configured to come up in static, but I can switch to another profile,
>> which runs dhcp. On the XP side, it's configured to try dhcp first and
>> if that fails default to a static address, which I use on my home
>> network.

>
> What tool do you use to quickly change network profiles in Linux?


SCPM. It's an option you have to install.

>
> In XP, do you get the fallback-to-static IP address from [connection] ->
> Properties -> General -> Internet Protocol (TCP/IP) -> Properties ->
> Alternate Configuration -> User configured? If not, then where?


I don't recall the exact details, but it's something like that. You wind up
with two configuration pages, with the first set to use dhcp and the other
configured for a static address.

--

(This space intentionally left blank)
 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      10-27-2004, 02:18 AM
In article <(E-Mail Removed)>, Andrew Schulman wrote:
>> You have two lousy computers - there is no need for DHCP.

>
>There is at least one good reason for using DHCP even in such a situation:
>if one of the hosts is a laptop that may want to travel and connect to
>other networks, then it makes sense to configure it to get its IP address
>by DHCP. That's why I use DHCP in my small home LAN.o


Our security types will not allow personal computers in. They also will
not allow "company" computers to go wandering out the door except with
paperwork that typically weighs more than the stupid computer.

If you are running something that uses SysVInits (where you have 7
run levels), an easy trick is to configure FOR EXAMPLE runlevel 3
as your home setup, runlevel 4 as a different one, runlevelm 5 as
still another, and if you are desperate, runlevel 2 as still another.
Some distributions don't like this concept, but it can be done. In
brief, you simply duplicate the runlevel script links EXCEPT for the
one that runs your network setup script.

Another way is to hack the first boot script that runs (often rc.sysinit)
so that after it mounts the disks read/write, it asks you what network
configuration to run, perhaps off of a menu. Based on that input, it then
copies appropriate network scripts to the appropriate place, and finishes
booting.

>In fact the IP addresses are fixed, because that's the way I've configured
>my DHCP server; but the hosts still use DHCP to get their addresses.


which gets around the "WTF is the name of this/that computer now" problem.

Old guy

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to switch setup from fixed IP to receive dynamic IP from DHCP server (and vice versa)? Matthew Lincoln Linux Networking 7 06-04-2008 08:28 AM
DHCP server not configured with DNS dynamic ID JS Windows Networking 0 04-08-2008 06:37 PM
How to configure Dynamic IP's in my linux server amit.tania@gmail.com Linux Networking 4 11-16-2005 03:24 AM
Redhat 9.0 dhcp client & windows 2003 dhcp server: dynamic dns update Mads Ravn Linux Networking 0 06-29-2004 05:27 PM
dhcp and dynamic dns Adrian Inman Linux Networking 0 08-26-2003 12:23 AM



1 2 3 4 5 6 7 8 9 10 11