FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-03-2009, 07:56 AM
Hal Vaughan
 
Default Does DNSMasq (or other DNS/DHCP Servers) Cache Old Addresses?

I'm adding a new system to my LAN. The DNS is running DNSMasq and is
on Etch. The new system is running Lenny. I edited the /etc/network/
interfaces file to include the following (other than loopback, the
only interface in the file):


auto eth0
iface eth0 inet static
address 172.16.7.111
netmask 255.255.0.0
gateway 172.16.7.1

Originally, when Debian set up the system, it used DHCP instead of a
static IP. This IP address (172.16.7.111) is defined on the DNS
server in /etc/hosts (which DNSMasq uses for config). When Debian-
Lenny set this up under DHCP, it was assigned the address
172.16.7.131. I edited the interfaces file to include the above. If
I did "/etc/init.d/networking restart," then it would again get the ...
131 address. If I did "ifup eth0" (after doing ifdown first), then
it'd get the 111 address it should have, but in at least one case, a
few minutes later I checked and it was back to 131.


I finally shut down the new system and rebooted the DNS server --
after having shut off networking on the new system and restarting
DNSMasq on the DNS. Then I brought up the DNS server, and after that,
brought up the new system. Now it's working and it finally let me
define eth0:0 as well (which it kept choking on before).


So why did it keep getting forced to use the 172.16.7.131 address
instead of the one ending in 111? Did DNSMasq cache the MAC address
or did the new workstation cache the info and reuse it automatically?
What was it that the reboot would have restarted that would allow this
system to finally get the specified address after the reboot?


Thanks for any help or answers on this!


Hal


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-03-2009, 10:59 AM
Aneurin Price
 
Default Does DNSMasq (or other DNS/DHCP Servers) Cache Old Addresses?

On Tue, Mar 3, 2009 at 8:56 AM, Hal Vaughan <hal@halblog.com> wrote:
> I'm adding a new system to my LAN. *The DNS is running DNSMasq and is on
> Etch. *The new system is running Lenny. *I edited the
> /etc/network/interfaces file to include the following (other than loopback,
> the only interface in the file):
>
> auto eth0
> iface eth0 inet static
> address 172.16.7.111
> netmask 255.255.0.0
> gateway 172.16.7.1
>
> Originally, when Debian set up the system, it used DHCP instead of a static
> IP. *This IP address (172.16.7.111) is defined on the DNS server in
> /etc/hosts (which DNSMasq uses for config). *When Debian-Lenny set this up
> under DHCP, it was assigned the address 172.16.7.131. *I edited the
> interfaces file to include the above. *If I did "/etc/init.d/networking
> restart," then it would again get the ...131 address. *If I did "ifup eth0"
> (after doing ifdown first), then it'd get the 111 address it should have,
> but in at least one case, a few minutes later I checked and it was back to
> 131.
>
> I finally shut down the new system and rebooted the DNS server -- after
> having shut off networking on the new system and restarting DNSMasq on the
> DNS. *Then I brought up the DNS server, and after that, brought up the new
> system. *Now it's working and it finally let me define eth0:0 as well (which
> it kept choking on before).
>
> So why did it keep getting forced to use the 172.16.7.131 address instead of
> the one ending in 111? *Did DNSMasq cache the MAC address or did the new
> workstation cache the info and reuse it automatically? *What was it that the
> reboot would have restarted that would allow this system to finally get the
> specified address after the reboot?
>
There's no problem with the server - and techincally no *configuration*
problem with the client. It is the norm for a DHCP server to give the same
address every time to a given machine unless there is a particular reason
not to, so if the client makes a DHCP request then it will get its
preferred dynamic IP (off the top of my head I don't recall whether this
is because the client requests it or because the server stores the MAC
address, but it's definitely the usual behaviour). The question then is
why the client was asking for a dynamic IP address when it had a static
address configured, and the answer is probably as follows:

You changed /etc/network/interfaces, and then did /etc/init.d/networking
restart, yes? In this case, you had a DHCP client running, then switched
to static configuration. Restarting networking causes the interfaces
defined to be brought down, but because you had changed it, there were no
DHCP interfaces defined, so dhclient was never stopped. The static
interface was then brought up correctly, but the dhclient still running
would periodically make a DHCP request and overwrite it. Killing dhclient
would have solved your problem, or obviously rebooting, as you found.

Nye


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-03-2009, 12:02 PM
Tzafrir Cohen
 
Default Does DNSMasq (or other DNS/DHCP Servers) Cache Old Addresses?

On Tue, Mar 03, 2009 at 03:56:04AM -0500, Hal Vaughan wrote:
> I'm adding a new system to my LAN. The DNS is running DNSMasq and is on
> Etch. The new system is running Lenny. I edited the /etc/network/
> interfaces file to include the following (other than loopback, the only
> interface in the file):
>
> auto eth0
> iface eth0 inet static
> address 172.16.7.111
> netmask 255.255.0.0
> gateway 172.16.7.1
>
> Originally, when Debian set up the system, it used DHCP instead of a
> static IP. This IP address (172.16.7.111) is defined on the DNS server
> in /etc/hosts (which DNSMasq uses for config). When Debian-Lenny set
> this up under DHCP, it was assigned the address 172.16.7.131. I edited
> the interfaces file to include the above. If I did
> "/etc/init.d/networking restart," then it would again get the ...131
> address. If I did "ifup eth0" (after doing ifdown first), then it'd get
> the 111 address it should have, but in at least one case, a few minutes
> later I checked and it was back to 131.
>
> I finally shut down the new system and rebooted the DNS server -- after
> having shut off networking on the new system and restarting DNSMasq on
> the DNS. Then I brought up the DNS server, and after that, brought up
> the new system. Now it's working and it finally let me define eth0:0 as
> well (which it kept choking on before).
>
> So why did it keep getting forced to use the 172.16.7.131 address
> instead of the one ending in 111? Did DNSMasq cache the MAC address or
> did the new workstation cache the info and reuse it automatically? What
> was it that the reboot would have restarted that would allow this system
> to finally get the specified address after the reboot?

The log of dnsmasq is at /var/log/daemon.log .

When your computer asks for an address, does it:

* Just use DHCPDISCOVER ?
* Uses DHCPDISCOVER but with a preferred IP address?
* Uses DHCPREQUEST directly?

--
Tzafrir Cohen | tzafrir@jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir@cohens.org.il | | best
ICQ# 16849754 | | friend


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 01:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org