0

I have two Linux boxes and a Mac.

1) Linux-1 is on an internal network. Linux-1 has a bunch of external hdd and running a samba server, smb-1, sharing files from these hdds.

2) Linux-2 has two net interfaces, one internal and one external. It mounts smb-1. It also runs samba server, smb-2 which tries to share with machines on external network.

3) Mac-OS wants to access the files and folders of smb-1 through smb-2 mount.

But it can't. It sees smb-2, and mounts it, but all it gets is the share point directory with no files. Is this setup possible ? Can I share the already shared samba server files ?

Thanks...

  • 1
    Is there some reason you can't accomplish this with routing? Re-exporting network filesystems is usually a VERY bad idea - in that it usually doesn't work. There are deprecated options that may allow this to work, but it will be ungodly slow. – Spooler Jul 19 '17 at 16:37
  • Yes, sure, routing might be the other solution that I can explore. Any samba specific pointer or do you have a pointer to the ungodly deprecated options ? – iamauser Jul 19 '17 at 18:51
0

While it may be possible, it certainly isn't advisable. You should really put Lunux-2 on the internal network, then put a router between that network and your external network. You can find some reasonable used Cisco gear for sale most anywhere online. Then set up a split horizon DNS config that will allow that Linux-2 box to be seen from both outside and inside. A bit more complex, yes. But much more secure and probably more reliable too!

0

Anyone in this situation and wants to find a solution can give this a try:

Masquerade the internal network on Linux-2. I am using a Fedora server with eth1 on the internal network zone and eth0 on public zone.

 firewall-cmd --zone=internal --change-interface=eth1 --permanent
 firewall-cmd --zone=internal --add-masquerade --permanent

Port forward all the samba ports from Linux-2 to Linux-1. Linux-1 has IP: 10.10.100.50.

firewall-cmd --zone=public --add-forward-port=port=137:proto=tcp:toaddr=10.10.100.50 --permanent
firewall-cmd --zone=public --add-forward-port=port=138:proto=tcp:toaddr=10.10.100.50 --permanent
firewall-cmd --zone=public --add-forward-port=port=139:proto=tcp:toaddr=10.10.100.50 --permanent
firewall-cmd --zone=public --add-forward-port=port=445:proto=tcp:toaddr=10.10.100.50 --permanent

With this much of work, you can connect any client on the external network using the IP of Linux-2 which is also connected to your external network.

For example on Mac OS X, use Finder and Go and then Connect to Server and then type the IP of Linux-2, i.e. smb://192.168.200.101

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.