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 11-24-2006, 01:07 PM   #1
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Rep: Reputation: 30
Exclamation samba server different network


I have a gateway debian sarge with 3 eths.Samba server is on network 192.168.1.0 the XP machine on 192.168.2.0.First of all can samba be on a different network from the client ?In this case by iptables SNAT and routeadd gw can i make this two networks to communicate? How?They actually don't !
Thanks !
 
Old 11-24-2006, 01:43 PM   #2
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Task to do :
* Make your samba get pinged from XP.(fix routing tables at gateway)
* Also make sure you do not have explicit host allow/deny entries. (could create problem)

& then instead of refrencing your samba server via its name(from clients).. map it with its ip. e.g. \\samba-ip\sharename.

Though you should setup WINS for cross subnet netbios name resolutions.
 
Old 11-24-2006, 03:45 PM   #3
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
Sure they do ping each other i have disabled firewalls on each machine ,too.
I will give a look to the links you gave , thanks !
p.s.
I was interested to the rsync link too but it points to samba as well ... you don't have rsync on your blog !!

Last edited by gabsik; 11-24-2006 at 06:40 PM.
 
Old 11-24-2006, 07:21 PM   #4
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
Definitly the two networks communicate now(from the linuxbox i'm configuring the windows box with vnc) i have properly set iptables postrouting snat and default routes.As the smbclient -L says it is a matter of name resolution:
Quote:
root@www:~# smbclient -L winzoz
added interface ip=192.168.1.4 bcast=192.168.1.255 nmask=255.255.255.0
Client started (version 3.0.14a-Debian).
resolve_lmhosts: Attempting lmhosts lookup for name winzoz<0x20>
resolve_wins: Attempting wins lookup for name winzoz<0x20>
resolve_wins: using WINS server 127.0.0.1 and tag '*'
Negative name query response, rcode 0x03: The name requested does not exist.
resolve_hosts: Attempting host lookup for name winzoz<0x20>
Connecting to 192.168.2.3 at port 445
Password:
Doing spnego session setup (blob length=16)
server didn't supply a full spnego negprot
Got challenge flags:
Got NTLMSSP neg_flags=0x628a0215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60080215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60080215
Domain=[GAB] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
tree connect failed: NT_STATUS_DUPLICATE_NAME
What i didn't understand yet is what is a WINS server ?
Configuring XP is it my linuxbox or the local XP machine ?I'm googling around but i did not find anything yet!I'm for as much simple as possible samba configuration but things like lmhosts , wins , netlogon are confusing me . This is my smb.conf :
Quote:
# Samba config file created using SWAT
# from 192.168.2.2 (192.168.2.2)
# Date: 2006/11/21 20:44:26

# Global parameters
[global]
netbios name = WWW
server string = %h server (Samba)
workgroup = GABRIX
security = SHARE
domain master = Yes
local master = Yes
preferred master = Yes
os level = 32
obey pam restrictions = Yes
passdb backend = tdbsam, guest
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
wins support = Yes
panic action = /usr/share/samba/panic-action %d
invalid users = root
load printers = Yes
printcap name = cups
printing = cups
lpq command = %p
lprm command =

# Useradd scripts
add user script = /usr/sbin/useradd -m %u
delete user script = /usr/sbin/userdel -r %u
add group script = /usr/sbin/groupadd %g
delete group script = /usr/sbin/groupdel %g
add user to group script = /usr/sbin/usermod -G %g %u
add machine script = /usr/sbin/useradd -s /bin/false/ -d /var/lib/nobody %u
idmap uid = 15000-20000
idmap gid = 15000-20000


# sync smb passwords woth linux passwords
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
passwd chat debug = yes
unix password sync = yes

# set the loglevel
log level = 3

[homes]
comment = Home Directories
path = /home/gabrix
read only = No
create mask = 0774
directory mask = 0774

[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0777
printable = Yes
browseable = No

[netlogon]
comment = Network Logon Service
path = /home/samba/netlogon
admin users = Administrator
valid users = %U
read only = no
[profile]
comment = User profiles
path = /home/samba/profiles
valid users = %U
create mode = 0600
directory mode = 0700
writable = yes
browsable = no

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
write list = root, gabrix

[cdrom]
comment = Samba server's CD-ROM
path = /media/cdrom0
guest ok = Yes
locking = No
preexec = /bin/mount /media/cdrom0
postexec = /bin/umount /media/cdrom0
Thanks !!!

Last edited by gabsik; 11-24-2006 at 07:24 PM.
 
Old 11-25-2006, 12:58 AM   #5
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
LinuBox is going to server Windows share names(i apt-get installed winbind) XP home edition just can't be part of a domain.
Quote:
root@www:~# smbclient -L winzoz
Password:
Domain=[WINZOZ] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

Sharename Type Comment
--------- ---- -------
HPpsc1317 Printer hp psc 1310 series
IPC$ IPC IPC remoto
print$ Disk Driver della stampante
SharedDocs Disk
DiscoD Disk
KETA (F) Disk
Domain=[WINZOZ] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

Server Comment
--------- -------

Workgroup Master
--------- -------
That's a better smbclient -L but still it's not enough.XP desn't mount the linux share.What about the lmhosts file ?It has to be on both linux and win machine , right ???
 
Old 11-25-2006, 02:12 PM   #6
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by gabsik
Definitly the two networks communicate now(from the linuxbox i'm configuring the windows box with vnc) i have properly set iptables postrouting snat and default routes.
I really dont buy the idea of NATting because SNATing broadcast packets wont help you out. Network browsing wont work this way (WINS is what we opt for cross subnet browsing in real big LAN networks) So comment that rule out from your firewall script.

After you trash that iptables rule out, you have now got two (infact more than two) ways to make your samba+winHOME NETBIOS-name resolutions work(this is the only problem you have, as if in case you would have browsed your samba server via its ip, it would have worked a long way back).
Prior to moving these two ways.. you got to make sure that you can ping b/w these two boxes without natting.

1.
Easiest way out --> Add another virtual ethernet interface at samba server with an ip belonging to xp-home-net-class i.e. 192.168.2.X .
Thats it!
The NETBIOS name resolutions would be done directly now as both samba server & XP-HOME box fall in a same subnet.

2.
At samba & windows box; modify your lmhosts file to refer each other by its name.
At samba server, modify /etc/samba/lmhosts with
XP-IP XP-BOX-NETBIOS-NAME

& @ windows box, modify \%systemroot%\system32\drivers\etc\lmhosts.sam
SAMBA-IP SAMBA-BOX-NETBIOS-NAME

Enable lmhosts lookup under your network advance settings (& import it if you want to avoid a restart)

This is done as well.
 
Old 11-25-2006, 02:16 PM   #7
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by gabsik
p.s.
I was interested to the rsync link too but it points to samba as well ... you don't have rsync on your blog !!
Here's that rsync link http://amitsharma.linuxbloggers.com/how_to_rsync.htm
I've fixed that link as well. And i am sorry i havent updated this blog for a long time; but it still works flawlessly.
 
Old 11-26-2006, 10:24 AM   #8
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
Thanks for reply amitsharma_26 your advice sound to be on the case .I was off this weekend , i will let you know every progress !
 
Old 11-27-2006, 12:30 PM   #9
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
When import lmhosts file on XP it gives me an error sayng i should change name to lmhosts file ????
Anyway still nothing ...
Quote:
gabrix@www:~$ smbclient -L winzoz
Password:
Domain=[WINZOZ] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

Sharename Type Comment
--------- ---- -------
HPpsc1317 Printer hp psc 1310 series
IPC$ IPC IPC remoto
print$ Disk Driver della stampante
SharedDocs Disk
DiscoD Disk
Domain=[WINZOZ] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

Server Comment
--------- -------

Workgroup Master
--------- -------
 
Old 11-27-2006, 01:56 PM   #10
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by gabsik
When import lmhosts file on XP it gives me an error sayng i should change name to lmhosts file ????
Anyway still nothing ...
You should not get any error while importing it.
(you got to edit it prior to importing also)

For your convinience i have uploaded a screenshot as well, please refer it for the correct procedure.
 
Old 11-27-2006, 10:14 PM   #11
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
Yes i edited the file prior to importing it!It says 'it's impossible to create C:\WINDOWS\system32\drivers\etc\lmhosts file retry giving it an another name ... (translated from italian)'maybe it's just one of those xp error to ignore ...
 
Old 11-30-2006, 09:02 AM   #12
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by gabsik
Yes i edited the file prior to importing it!It says 'it's impossible to create C:\WINDOWS\system32\drivers\etc\lmhosts file retry giving it an another name ... (translated from italian)'maybe it's just one of those xp error to ignore ...
Are you sure that you are using administrator access at thix box while modifying the contents of lmhosts.sam file ?
 
Old 12-04-2006, 04:19 AM   #13
gabsik
Member
 
Registered: Dec 2005
Location: This planet
Distribution: Debian,Xubuntu
Posts: 567

Original Poster
Rep: Reputation: 30
Sure i'm administrator.Anyway the window machine is back on the same samba server network.Now shares are avialable fine.Thanks amitsharma_26 it was a nice lesson on samba.I never looked to samba this way and i think yours is the right linux attitude everybody should have in a linuxforum ... nice 1 !
 
  


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
Samba domain member server (DMS) group permissions in network with a Samba PDC srosa Linux - Networking 0 05-01-2006 05:55 PM
Can't see samba server on network noob454 Linux - Newbie 2 11-19-2004 04:22 PM
Can't See Samba server in network neighbourhood tapanga Linux - Networking 15 02-20-2004 11:11 AM
Can't Network via Samba Server Gallienus Linux - Networking 0 10-23-2003 11:07 AM
Can't see Samba server in My Network Places jsabbott25 Linux - Networking 3 06-25-2003 11:53 AM

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

All times are GMT -5. The time now is 10:55 PM.

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