0

I'm with some problems setting up a Samba server between two subnets;

I Have one subnet that has the Samba server and every computer in this lan can access the files. But now I have another server in another place with a subnet and I want that the computers that are in this Server2 subnet access the files in the Samba that are in Server1. The servers are connected with an OpenVPN connection and they share a Cups server, both are Debian 5.10 servers and can ping on both sides and they recognize each other.

So my smb.conf looks like this:

[global]
netbios name = MY_SERVER
server string = Compartilhamento
workgroup = MY_GROUP
security = user
map to gues = Bad User
wins support = yes
dns proxy = no
os level = 100
auto services = global
name resolve order = lmhosts, host, wins, bcast
cups options = raw
load printers = yes
interfaces = lo eth1 192.168.1.0/24
hosts allow = 127. 192.168.1. 192.168.10.
passdb backend = tdbsam
ntlm auth = yes
preferred master = yes
domain master = yes
logon path = %Nprofile%u
invalid users = root
server min protocol = NT1

In the hosts allow I put both subnets. The Server1 is 192.168.1. and Server2 is 192.168.10. When I try to log in via smbclient using this command: smbclient -d3 -U "MY_GROUP/user" //192.168.1.3/share I get this error:

lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[global]"
added interface enp11s0 ip=192.168.2.253 bcast=192.168.2.255 netmask=255.255.255.0
added interface enp12s2 ip=192.168.10.3 bcast=192.168.10.255 netmask=255.255.255.0
Client started (version 4.13.13-Debian).
Connecting to 192.168.1.3 at port 445
Connecting to 192.168.1.3 at port 139
protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE

Or when I try to mount the Samba server in the Server2 with mount -t cifs -o username=user,vers=1.0,sec=ntlmssp //192.168.1.3/share /mnt/ it returns

mount: /mnt: a chamada de sistema de mount(2) falhou: Host está desligado.

I don't know how I connect the servers. Do I have to mount Samba in Server2? Am I losing something?

I saw 2 posts that look like my problem, but they do not help at all, they are Samba share across two subnets and Mount CIFS Host is down

I asked the same question in ServerFault but I get no answer, so I'm asking here.

1 Answer 1

1

https://www.oreilly.com/openbook/samba/book/ch04_06.html

The interfaces option outlines the network addresses to which you want the Samba server to recognize and respond. This option is handy if you have a computer that resides on more than one network subnet. If this option is not set, Samba searches for the primary network interface of the server (typically the first Ethernet card) upon startup and configures itself to operate on only that subnet. If the server is configured for more than one subnet and you do not specify this option, Samba will only work on the first subnet it encounters. You must use this option to force Samba to serve the other subnets on your network.

It looks like your interfaces line in your smb.conf is missing the declaration of the other subnet. It should read something like interfaces eth1 192.168.0.3/24 192.168.10.1/24

see samba man page for interface examples: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html

Also be mindful of hosts allow and hosts deny in smb.conf as getting those incorrect can cause denial. In addition to any firewall settings, I recommend for starters you do not have either hosts allow | deny specified so it allows all and disable firewall until you get it working then reapply those security items one step at a time so you know what to correct if it stops working.

1
  • I made the changes in the interfaces = lo eth1 192.168.1.0/24 192.168.10.3/24 192.168.2.1/24 and in the hosts allow = 127. 192.168.1. 192.168.10. 192.168.2.. But still not working. The firewall is allowing the ports 139 and 445, so I think this is not the problem... Commented Sep 20, 2023 at 16:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .