DHCP causes Samba share loss

I’m running Windoze XP (name nikyo-nu) in a VMware Workstation and connecting to Samba shared folders (on Samba/DHCP server zanshin).

2 or 3 times a day I get an error in Windoze and lose connection temporarily and have to save my files under new names.

I googled this and it seemed to be an oplocks problem so I disabled kernel oplocks and oplocks on the shares but is still happens.

Examining /var/log/messages when it happens I get notices from DHCP …

<snip>
Aug 13 11:44:51 zanshin dhcpd: DHCPDISCOVER from 00:0c:29:9f:de:ef via eth2
Aug 13 11:44:52 zanshin dhcpd: DHCPOFFER on 192.168.9.166 to 00:0c:29:9f:de:ef (nikyo-nu) via eth2
Aug 13 11:44:52 zanshin dhcpd: DHCPREQUEST for 192.168.9.166 (192.168.9.254) from 00:0c:29:9f:de:ef (nikyo-nu) via eth2
Aug 13 11:44:52 zanshin dhcpd: DHCPACK on 192.168.9.166 to 00:0c:29:9f:de:ef (nikyo-nu) via eth2
</snip>

Does anyone have any ideas what’s causing this 'cos it’s driving me up the wall?

Alan

On Wed, 13 Aug 2008 11:06:03 GMT
fudokai <fudokai@no-mx.forums.opensuse.org> wrote:

>
> I’m running Windoze XP (name nikyo-nu) in a VMware Workstation and
> connecting to Samba shared folders (on Samba/DHCP server zanshin).
>
> 2 or 3 times a day I get an error in Windoze and lose connection
> temporarily and have to save my files under new names.
>
> I googled this and it seemed to be an oplocks problem so I disabled
> kernel oplocks and oplocks on the shares but is still happens.
>
> Examining /var/log/messages when it happens I get notices from DHCP
> …
>
> <snip>
> Aug 13 11:44:51 zanshin dhcpd: DHCPDISCOVER from 00:0c:29:9f:de:ef via
> eth2
> Aug 13 11:44:52 zanshin dhcpd: DHCPOFFER on 192.168.9.166 to
> 00:0c:29:9f:de:ef (nikyo-nu) via eth2
> Aug 13 11:44:52 zanshin dhcpd: DHCPREQUEST for 192.168.9.166
> (192.168.9.254) from 00:0c:29:9f:de:ef (nikyo-nu) via eth2
> Aug 13 11:44:52 zanshin dhcpd: DHCPACK on 192.168.9.166 to
> 00:0c:29:9f:de:ef (nikyo-nu) via eth2
> </snip>
>
> Does anyone have any ideas what’s causing this 'cos it’s driving me up
> the wall?
>
> Alan
>
>

Your loss is based on the dhcp lease renewals. How long are your dhcp
leases? Usually best at > 1 day of things aren’t going to change much.

When the dhcp lease expires, the windows machine ‘unhooks’, requests a new ip
address and lease, and then ‘rehooks’ the network up again. The dhcp server
gives it the same IP address, based off of MAC addressing, and all is good.
But it’s the ‘unhook/rehook’ that messes with the loss of the shares.

If you’re using the default dhcp server settings, the default lease time is
600 seconds (10 minutes), and the maximum lease anyone can request is 7200
seconds (2 hours).

Change the options to longer values and restart the dhcpd daemon. This
should help.

Options in /etc/dhcpd.conf:

default-lease-time 86400;
max-lease-time 86400;

would set both default and max to 1 day. (86400 seconds)

Assuming you’re using ‘dhcpd’ of course. dnsmasq is similar, and so forth.

Loni


L R Nix
lornix@lornix.com