Long version:
My media player needs to access a samba share that is available behind an OpenVPN server. Problem is that the media player has no way of connecting to the VPN server. So I have my arch server for that. My first idea was to mount the samba share on the server, and then reshare it using SMB or NFS so that the media player can access it. I have tried both protocols but I end up with empty folders (the share is shown, but the content is empty). Can I make this work some how?
What I've tried:
* Both NFS and SMB
* Disabled oplocks in Samba
* Tried sharing a symlink to the mounted folder
What else can I try?
Edit:
Hm, thought of something. Can I somehow proxy the connections using iptables? So all smb connections to my arch servers gets sent throught the VPN to the remote server?
Edit 2:
Solved! But it's not the prettiest solution:
iptables -t nat -A PREROUTING -p tcp --dport 137 -j DNAT --to-destination xxx.xxx.xxx.xxx:137
iptables -t nat -A PREROUTING -p tcp --dport 138 -j DNAT --to-destination xxx.xxx.xxx.xxx:138
iptables -t nat -A PREROUTING -p tcp --dport 139 -j DNAT --to-destination xxx.xxx.xxx.xxx:139
iptables -t nat -A PREROUTING -p tcp --dport 445 -j DNAT --to-destination xxx.xxx.xxx.xxx:445
iptables -t nat -A POSTROUTING -j MASQUERADE
Where xxx.xxx.xxx.xxx is the IP to the server behind the VPN-server.
]]>