When undocking my notebook from the docking station with its wired ethernet connection I let network manager automatically switch on the wifi radio. Upon entering the docking station I let it switch off wifi because the wired connection is preferable.

Problem is: All accesses to files or folders on cifs shares I mounted before hang for 120 seconds. This leads to applications hanging, if they access those shares (like shell sessions in those directories, filemanagers with an open tab there, etc). Their processes get stuck in the dreadful uninterruptible state.

The kernel log says: kernel: CIFS VFS: Server has not responded in 120 seconds. Reconnecting...

Question: How can I reduce that timeout so that I don't have to spend 2+ minutes on coffee each time I switch to/from the docking station because all my applications hang?

More details:

  • Both interfaces have different IPs on the same subnet and can obviously both reach the file-server
  • sample /etc/fstab line:

//server/install /mnt/net/install cifs uid=bob,credentials=/etc/cifs-credentials,_netdev,user,soft 0 0

  • sample output from mount | grep cifs:

//server/install on /mnt/net/install type cifs (rw,nosuid,nodev,noexec,relatime,vers=1.0,cache=strict,username=bob,domain=bobsdom,uid=1000,forceuid,gid=0,noforcegid,addr=[serverIP],unix,posixpaths,serverino,acl,rsize=1048576,wsize=65536,actimeo=1,_netdev,user)

What I tried:

  • The "soft" and "hard" mount options. They do not change that behaviour, even though the man page's text on "soft" suggests that
  • Made sure there is no packet loss on either interface and latency and bandwidth are excellent (GBit ethernet and 802.11ac wifi with strong signal). This makes me sure it's really a cifs timeout because of the IP change.
  • The server (samba 3.6) is having no network issues and no packet loss either.
  • Googled for a knob in cifs to reduce the timeout to something sensible like 15sec. Only found one for Windows. It's called HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\SessTimeout and is exactly what I want. Interestingly MS reduced this timeout in Win 8.1 to 20sec as well ...
  • Using route metrics instead of turning on/off wifi to have both routes up and let the kernel just prefer the ethernet route. This approach is flawed though, because then the kernel send replies to packets arriving via wireless out on the wired interface. Could be solved with some "ip rule" magic but I'd really prefer to just toggle the wifi radio.

1 Answer 1


One working solution is to set both interfaces to the same static IP address. That way cifs doesn't timeout, because it doesn't have to re-establish the connection from a different IP on the same subnet.

This also means that SSH connections are kept alive during wired<=>wifi switches without needing fancy tools like Mosh.

It has drawbacks, too:

  • Requires static IP addresses instead of DHCP
  • IP conflict if my both interfaces where up simultaneously. My network manager dispatcher script prevents this, though.
  • Beginning to like this solution more and more because it has the added benefit of keeping ssh sessions alive and really all applications that have a stateful tcp/ip connection Dec 27, 2014 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.