You are not logged in.

#1 2016-02-08 16:08:01

sawa
Member
Registered: 2015-03-22
Posts: 15

Can samba client connect samba server with different network?

Can samba client connect samba server with different network?
network-test1.png
for example:
There is a network called network A , 192.168.0.0/24
Router1 's address is 192.168.0.1
Desktop3 is a windows printer server (192.168.0.100

Router2 is a device in network A,
and its WAN PORT connected to router1's LAN PORT, 
Router2 's address is 192.168.1.1
My computer is Desktop4 (192.168.1.100) is in network B, 192.168.1.0/24

When I ping Desktop3, my computer can send and receive the echo request & reply successfully;
but when I scan the windows server with command " smbtree -U user1 "
I cannot get any message.

I use wireshark to check the packet that Desktop4 sent out,
the destination is 192.168.1.255

now I know that "smbtree" broadcast the current network and find whether 192.168.1.0/24 have smb sever
but how can I also scan another network/connect to smb server in 192.168.0.0/24 ?


ξ( ✿>◡❛)▄︻▇▇〓▄︻┻┳═一                                                  Σ(っ°Д °;)っ Σ(っ°Д °;)っ Σ(っ°Д °;)っ

Offline

#2 2016-02-13 16:10:58

evotopid
Member
From: Switzerland
Registered: 2013-02-03
Posts: 8

Re: Can samba client connect samba server with different network?

What you want is definitely possible, if you could use Samba only on your local network it would be quite pointless, wouldn't it?

I'm by no means a network expert but here are two ideas I have that might lead you to your goal:

  1. To connect from Desktop 4 to a service (here Samba) that is running on Desktop 3, you need to configure Router1 (check router manuals and instructions online) to forward the samba port (or you could also pick another one) from Router1 to Desktop 3. Desktop 4 will be able to connect to the Samba server by connecting to Router1 as if the server was running the service (but the traffic will be forwarded to Desktop 3 doing the actual handling).

  2. I assume these are both your own networks. If one of these routers is a WIFI router maybe it's possible to configure it to extend the LAN of the other router and making all devices connected to the both routers share the same network? I don't know how you would go about it but if that is possible I think this might be the easiest way (also in case you want to add further services in the future) but if you want to have two separate networks for security reasons for example this might not really be an option.

Let me know if this got you any further or you still have issues.

Offline

#3 2016-02-14 19:51:37

sawa
Member
Registered: 2015-03-22
Posts: 15

Re: Can samba client connect samba server with different network?

Thank you for your reply ,evotopid big_smile
I tried the solution 2.
The routers that I am using both are TP-link, I found that there is a function call "WDS-Bridging" it can extend my LAN by using WIFI. It is quite convenient, no need to do other configuration. I can connect to my printer perfectly in this solution big_smile

I also tried port forwarding. It does not works:(
But I found that the terms "Port-forwarding" in TP-Link routers is called "Virtual Server" (it confused me
I did the following :
added the ports of samba service to "Virtual Server" on Router1 (follow this guide - http://www.cyberciti.biz/faq/what-ports … x-systems/ )

Finally I found another way::
Disable the "Virtual server" function in router1 first;
then change details in samba configuration file ( /etc/samba/smb.conf )
find the line ";   wins server = w.x.y.z"
change it to the server IP addr, eg "wins server = 192.168.0.100"
and open terminal, type:
# systemctl restart smbd
then it works!
( I have no idea why it works without using port forwarding...

But in this case, I cant "discover" the server if I do not know the server IP address. I am still checking how to achieve this function.


ξ( ✿>◡❛)▄︻▇▇〓▄︻┻┳═一                                                  Σ(っ°Д °;)っ Σ(っ°Д °;)っ Σ(っ°Д °;)っ

Offline

#4 2016-02-16 18:34:19

mkey
Member
Registered: 2015-02-09
Posts: 38

Re: Can samba client connect samba server with different network?

Your problem is related to network name resolution.
A samba client can rely on various way to resolve the samba server name and will try them sequentially until it gets a respond (1. check host file, 2. DNS lookup, 3. WINS query, etc.)
Without particular configuration, this will end up achieving a network broadcast query (basically a "Who is Samba server?" request) in order to find out the server.
However, unless explicitly forwarded, broadcast packets cannot be routed and will simply be confined into your LAN. That's why Desktop4 will never be able to find out which host holds the service.
You must provide your client with the server IP address by manual configuration or by adding a DCHP option if you want it to dynamically discover the server.

Offline

Board footer

Powered by FluxBB