LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-10-2011, 08:08 AM   #1
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
SAMBA connect laptop -> desktop works, desktop -> laptop won't work


Hi guys

I've got two machines (one a laptop, one a desktop) running the same SAMBA version, on FC11 (old I know, but its a home net behind a router / firewall)

The laptop is 192.168.0.24
The desktop is 192.168.0.22

From the laptop, I can smbclient -L 192.168.0.22 (to the desktop) and see the shares it presents.

Form the desktop, I can smbclient -L 192.168.0.24 (to the laptop) and see the shares it presents.

However, I can ONLY connect in ONE direction...

smbd and nmbd is running on both machines.

I can only do laptop (192.168.0.24) to desktop (192.168.0.22):

Code:
On laptop:

mount -t cifs "//192.168.0.22/shared" /mnt/remote  -o username=guest,password="",uid=stefan,dirmode=0775,filemode=0775
doing this from desktop (192.168.0.22) to laptop (192.168.0.24):

Code:
On desktop:

mount -t cifs "//192.168.0.24/shared" /mnt/remote  -o username=guest,password="",uid=stefan,dirmode=0775,filemode=0775
always results in

Code:
[root@stefanhost ~]# mount -t cifs "//192.168.0.24/shared" /mnt/remote  -o username=guest,password="",uid=stefan,dirmode=0775,filemode=0775
retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
[root@stefanhost ~]#
This is irrespective of whether the laptop is currently successfully connected to the desktop or not.

Here's the laptop's /etc/samba/smb.conf:
Code:
[global]

netbios name = stefan_laptop
workgroup = PGSI
security = share
log file = /var/log/samba.log 
log level =  1
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=16384 SO_SNDBUF=16384 
wins support = yes 
domain logons = no
logon drive = f: 
logon home = \\stefan\%U
os level = 99 
preferred master = yes
local master = yes
hosts allow = 192.168.0.22
encrypt passwords = yes
browseable = yes
lanman auth = yes 
lm announce = yes 
client lanman auth = yes
client plaintext auth = yes

[shared]
path = /mnt/win/shared
guest ok = yes 
writeable = yes 
create mode = 0666 
directory mode = 0777
browseable = yes
public = yes
Here's the desktop's smb.conf:

Code:
[global]

netbios name = stefan_desktop
workgroup = PGSI
security = share
log file = /var/log/samba.log 
log level =  1
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=16384 SO_SNDBUF=16384 
wins support = yes 
domain logons = no
logon drive = f: 
logon home = \\stefan\%U
os level = 99 
preferred master = yes
local master = yes
hosts allow = 192.168.0.24
encrypt passwords = yes
browseable = yes
lanman auth = yes 
lm announce = yes 
client lanman auth = yes
client plaintext auth = yes

[shared]
path = /mnt/win/shared
guest ok = yes 
writeable = yes 
create mode = 0666 
directory mode = 0777
browseable = yes
public = yes
Yes, both have a mounted and working /mnt/win/shared mountpoint in the Linux filing system.

IPtables has been disabled on BOTH machines. SELinux is off.

Any idea why I can only connect in ONE direction from 192.168.0.24 to 192.168.0.22, but never from 192.168.24 to 192.168.0.22?

I can see shares in both directions with smbclient -L:

From desktop (192.168.0.22) viewing laptop 192.168.0.24

Code:
[root@stefanhost ~]# smbclient -L 192.168.0.24
Enter stefan's password:
Domain=[PGSI] OS=[Unix] Server=[Samba 3.3.2-0.33.fc11]

        Sharename       Type      Comment
        ---------       ----      -------
        shared          Disk
        IPC$            IPC       IPC Service (Samba 3.3.2-0.33.fc11)
Domain=[PGSI] OS=[Unix] Server=[Samba 3.3.2-0.33.fc11]

        Server               Comment
        ---------            -------
        STEFAN_DESKTOP       Samba 3.3.2-0.33.fc11
        STEFAN_LAPTOP        Samba 3.3.2-0.33.fc11

        Workgroup            Master
        ---------            -------
        ACCOUNTING           ESNA1
        PGSI                 STEFAN_LAPTOP
        WORKGROUP            KHAPTA-WS01
[root@stefanhost ~]#
From laptop (192.168.0.24) viewing desktop 192.168.0.22

Code:
[root@stefanhost ~]# smbclient -L 192.168.0.22
Enter stefan's password:
Domain=[PGSI] OS=[Unix] Server=[Samba 3.3.2-0.33.fc11]

        Sharename       Type      Comment
        ---------       ----      -------
        shared          Disk
        IPC$            IPC       IPC Service (Samba 3.3.2-0.33.fc11)
Domain=[PGSI] OS=[Unix] Server=[Samba 3.3.2-0.33.fc11]

        Server               Comment
        ---------            -------
        STEFAN_DESKTOP       Samba 3.3.2-0.33.fc11
        STEFAN_LAPTOP        Samba 3.3.2-0.33.fc11

        Workgroup            Master
        ---------            -------
        ACCOUNTING           ESNA1
        PGSI                 STEFAN_LAPTOP
        WORKGROUP            KHAPTA-WS01
[root@stefanhost ~]#
Whenever the desktop tries to connect it is told that no such share exists on the laptop - even though smbclient -L to the laptop DOES show the share as available:

Code:
[root@stefanhost ~]# mount -t cifs "//192.168.0.24/shared" /mnt/remote  -o username=guest,password="",uid=stefan,dirmode=0775,filemode=0775
retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
[root@stefanhost ~]#
Anybody got any idea where I can start looking? Why can I connect in only one direction?

Thanks!
 
Old 10-10-2011, 08:31 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,243

Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
Just a thought. Have you set up /etc/hosts file on both systems? I have had lots of issues with samba, until I set one up, and copied it to all the clients.

It looks like it never tries to find the laptop.
 
Old 10-11-2011, 08:38 AM   #3
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Original Poster
Rep: Reputation: 103Reputation: 103
Hi!

Thanks for the response. I did this:

On the laptop's /etc/hosts

Code:
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.22 stefan_desktop
On the desktop's /etc/hosts

Code:
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.24 stefan_laptop
However, no change - the laptop can still connect to the desktop, but just as before, trying to connect the desktop to the laptop gives

On desktop:

Code:
[root@stefanhost ~]# mount -t cifs "//192.168.0.24/shared" /mnt/remote  -o username=guest,password="",uid=stefan,dirmode=0775,filemode=0775
mount error(113): No route to host
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
[root@stefanhost ~]# ping 192.168.0.24
[root@stefanhost ~]# ping 192.168.0.24
PING 192.168.0.24 (192.168.0.24) 56(84) bytes of data.
64 bytes from 192.168.0.24: icmp_seq=1 ttl=64 time=0.256 ms
64 bytes from 192.168.0.24: icmp_seq=2 ttl=64 time=0.250 ms
64 bytes from 192.168.0.24: icmp_seq=3 ttl=64 time=0.256 ms
^C
--- 192.168.0.24 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2239ms
rtt min/avg/max/mdev = 0.250/0.254/0.256/0.003 ms
[root@stefanhost ~]#
Also, I double checked that smbd and nmbd (started via smbd -D and nmbd -D) are running on the laptop. I've also reconfirmed that SELinux and iptables are disabled - still can only connect in one direction...

Thanks for the suggestion anyway!

Regards
 
Old 10-11-2011, 09:02 AM   #4
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,243

Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
This appears to be a routing issue, more than a samba problem.

Do you have a router in the network?

Have you looked at the default routes?

Do you have a /etc/hosts.allow and /etc/hosts.deny files? If yes, try renaming the deny file, and give it a try. Just some more thoughts.
 
Old 10-12-2011, 05:51 AM   #5
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Original Poster
Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by camorri View Post
This appears to be a routing issue, more than a samba problem.

Do you have a router in the network?

Have you looked at the default routes?

Do you have a /etc/hosts.allow and /etc/hosts.deny files? If yes, try renaming the deny file, and give it a try. Just some more thoughts.
Hi Cliff

Thanks for the reply.

Yes, there is the normal home-network scenario - router connected to ISP in non-bridged mode.

Here's what I see for default routes:

Desktop:

Code:
[root@stefanhost ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     1      0        0 eth0
192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
[root@stefanhost ~]#
Laptop:
Code:
[root@stefanlaptop ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     1      0        0 eth0
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
[root@stefanlaptop ~]#
Strange - the desktop has a "virbir0" network interface listed, but I very definitely only have one NIC in the machine. Could this have something to do with my problem?

I do have /etc/hosts.allow and /etc/hosts.deny files, I put each target machine's IP in the allow files on both, and renamed the .deny files to /etc/hosts/deny.bak.

No luck. Trying to connect form the desktop to the laptop gives

Code:
[root@stefanhost ~]# mount -t cifs "//192.168.0.20/shared" /mnt/remote  -o username=guest,password="",uid=stefan,dirmode=0775,filemode=0775
mount error(113): No route to host
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
[root@stefanhost ~]#
while the laptop still happily connects to the desktop.

So you suspect it might be a routing problem imposed by the fact that there is a router on the network?

Thank you for your help!

Kind regards,

Last edited by rylan76; 10-12-2011 at 08:19 AM.
 
Old 10-12-2011, 08:28 AM   #6
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,243

Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
Quote:
Strange - the desktop has a "virbir0" network interface listed, but I very definitely only have one NIC in the machine. Could this have something to do with my problem?
This interface shows up when you are using 'libvirtd' daemon. ( Developed by Red Hat for virtual machines ). I don't know if it could cause a problem or not. You could try deactivating the interface, and try again.

The other thing I would like to see you try, now that you have /etc/hosts files on both systems, is try the mount using the host name, not the IP address. It shouldn't make a difference, however, this is a strange problem. No problem pinging the laptop, but can't do a cifs mount with "No route to host".

One last thought, you could define a static route to the laptop and see if the mount works. Best of luck.
 
Old 10-14-2011, 09:35 AM   #7
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Original Poster
Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by camorri View Post
This interface shows up when you are using 'libvirtd' daemon. ( Developed by Red Hat for virtual machines ). I don't know if it could cause a problem or not. You could try deactivating the interface, and try again.
Ok, thanks.

Quote:
The other thing I would like to see you try, now that you have /etc/hosts files on both systems, is try the mount using the host name, not the IP address. It shouldn't make a difference, however, this is a strange problem. No problem pinging the laptop, but can't do a cifs mount with "No route to host".
Ok, I'll give it a try once I'm in that office again.

Quote:
One last thought, you could define a static route to the laptop and see if the mount works. Best of luck.
What is the syntax / command I'd use to define a static route of this kind?

Thanks for your help & suggestions!

Kind regards,
 
Old 10-14-2011, 12:13 PM   #8
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,243

Rep: Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861Reputation: 861
Quote:
What is the syntax / command I'd use to define a static route of this kind?
'ip route add' is the command. Here is a link for a How to...

-->What is the syntax / command I'd use to define a static route of this kind?

The is information in the man page for 'route'.
 
  


Reply



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 On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
laptop wireless won't connect in KDE but works in Gnome (Fedora 13) tommyttt Linux - Networking 7 11-28-2010 08:46 AM
cant connect desktop and laptop lucky.shubham Linux - Wireless Networking 5 10-14-2009 11:47 PM
can't connect a desktop and a laptop via wi-fi netimen Linux - Networking 5 09-20-2009 07:48 AM
Desktop replacement laptop that works well in Linux tkedwards Linux - Laptop and Netbook 1 03-10-2006 06:16 PM
belkin F5D7050UK on Suse 9.2 - Laptop works but desktop doesn't mhowell SUSE / openSUSE 2 10-12-2005 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration