Linux – Cannot mount a CIFS network share on Ubuntu

linuxnetwork-shareUbuntuvpnwindows-server-2008

I am trying to connect to Windows Server 2008 network share on Ubuntu, but for some reason it is not working.

I have the following entries in my fstab:

//server/foo    /mnt/foo    cifs    username=aron,password=foobar    0       0
//server/bar  /mnt/bar  cifs    username=aron,password=foobar    0       0

I get the following error after calling mount -a:

mount error(110): Connection timed out
Refer to the mount.cifs(8) manual page
(e.g. man mount.cifs)

The output of dmesg | tail is:

[ 6697.441061] CIFS VFS: Error connecting to socket. Aborting operation
[ 6697.441078] CIFS VFS: cifs_mount failed w/return code = -110

I have no clue about why this command is timing out. Any help is appreciated.

EDIT: the OP explained this was only happening when trying to mount over a VPN connection, but it seems to happen with a physical connection as well.

Best Answer

Solved the problem.

It turned out I had an entry in /etc/hosts that made my DC hostname resolve to a different IP address than the primary reverse resolver.

IE:

192.168.1.160 server

While 192.168.1.160 did not resolve back to this host.

I edited the hosts entry to reflect the correct IP-adress, which solved the issue.