DHCP to static IP - is this OK?

This is a discussion on DHCP to static IP - is this OK? within the Linux Networking forums, part of the Linux Forums category; I have a Redhat 7.2 box that is set up for dynamic addressing (DHCP client). This is working fine. ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-05-2003
Bob O'Connor
 
Posts: n/a
Default DHCP to static IP - is this OK?

I have a Redhat 7.2 box that is set up for dynamic addressing (DHCP client).
This is working fine. I also have a script that is run at boot time to
manually set the IP to some fixed address via ifconfig (don't ask). This
works fine.

My question is, is this OK (having dhcpd running and then fixing the IP vie
ifconfig)? Reason I ask is that occasionally the network plays dumb (no
ping, telnet, ftp, nothing). Is it possible and under what situation
could/would DHCP "reset" the IP to something other that what I set it to a
boot time with ifconfig?

Since I use fixed IP addressing I should probably disable DHCP but that's
for another day.

Thanks,
Bob


Reply With Quote
  #2 (permalink)  
Old 07-05-2003
Captain Dondo
 
Posts: n/a
Default Re: DHCP to static IP - is this OK?

On Sat, 05 Jul 2003 15:21:40 +0000, Bob O'Connor wrote:

> I have a Redhat 7.2 box that is set up for dynamic addressing (DHCP client).
> This is working fine. I also have a script that is run at boot time to
> manually set the IP to some fixed address via ifconfig (don't ask). This
> works fine.
>
> My question is, is this OK (having dhcpd running and then fixing the IP vie
> ifconfig)? Reason I ask is that occasionally the network plays dumb (no
> ping, telnet, ftp, nothing). Is it possible and under what situation
> could/would DHCP "reset" the IP to something other that what I set it to a
> boot time with ifconfig?


DHCP leases run out after a time, and the dhcpd client daemon gets a new
lease. It then resets the IP for that interface, along with a host of
other stuff like /etc/resolf.conf for DNS resolution.

Why not just 'chkconfig off dhcpd' or whatever the dhcp client is?

--Dondo

Reply With Quote
  #3 (permalink)  
Old 07-05-2003
Ian Northeast
 
Posts: n/a
Default Re: DHCP to static IP - is this OK?

Bob O'Connor wrote:
>
> I have a Redhat 7.2 box that is set up for dynamic addressing (DHCP client).
> This is working fine. I also have a script that is run at boot time to
> manually set the IP to some fixed address via ifconfig (don't ask).


Why not? Without knowing *why* you are doing something so strange it is
hard to suggest how to do it properly. Presumably you have a reason.

> This works fine.


But then you go on to say that it doesn't.

> My question is, is this OK (having dhcpd running and then fixing the IP vie
> ifconfig)?


Do you mean dhcpd? That is the DHCP server. The client is probably
dhcpcd or possibly dhclient.

No, it is not OK. If you are using a locally specified address you
should not be running a DHCP client.

> Reason I ask is that occasionally the network plays dumb (no
> ping, telnet, ftp, nothing). Is it possible and under what situation
> could/would DHCP "reset" the IP to something other that what I set it to a
> boot time with ifconfig?


Yes, if the lease expires and it has to get another. This is probably
what is causing the problem.

> Since I use fixed IP addressing I should probably disable DHCP but that's
> for another day.


You should. Alternatively, configure the DHCP server to always give you
the address you require (sometimes referred to as a "reservation"). If
you are not in control of the DHCP server, don't your network admins get
upset by your doing this?

Regards, Ian
Reply With Quote
  #4 (permalink)  
Old 07-05-2003
Martin Blume
 
Posts: n/a
Default Re: DHCP to static IP - is this OK?


Bob O'Connor <nospam@nospam.com> schrieb
> I have a Redhat 7.2 box that is set up for dynamic addressing (DHCP

client).
> This is working fine. I also have a script that is run at boot time to
> manually set the IP to some fixed address via ifconfig (don't ask). This
> works fine.
>
> My question is, is this OK (having dhcpd running and then fixing the IP

vie
> ifconfig)? Reason I ask is that occasionally the network plays dumb (no
> ping, telnet, ftp, nothing). Is it possible and under what situation
> could/would DHCP "reset" the IP to something other that what I set it to a
> boot time with ifconfig?
>
> Since I use fixed IP addressing I should probably disable DHCP but that's
> for another day.
>


You must always ensure that an IP address is only given to one machine only.
If two different machines have the same ip address, any third machine
talking to them gets confused and then the two machines will also get
confused (think of phoning a telephone number and having two people
responding at the same time). Your administration must check that e.g.
- manually set addressses are in the range 192.168.0.1-127
- dhcpd given addresses are in the range 192.168.0.128-253
- reserve 192.168.0.254 for troubleshooting
- any manually set address is not already in use.

Perhaps your network problems are due to the fact two machines use the same
ip address at the same time.

If a problem occurs, you could:
- note the ip address used by the machine which is having problems
- set the ip address to an address that is guaranteed to be free
- try to ping the ip address that was used by the machine which is having
problems
if a machine responds (might take a little bit of time until packets start
to flow again), this ip address was used by two machines at the same time,
which is a severe no-go.

HTH
Martin

PS: You can have sort of fixed ip addressing even with DHCP if you associate
MAC numbers with IP addresses.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:34 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0