TC and VPN

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Nice to hear that! To meet the LGPL licence requirements, I'm publishing the modified source code here (it's also available by e-mail on request):

If file smb\SmbTransport.java, change the function doDisconnect to:

Code: Select all

    protected void doDisconnect( boolean hard ) throws IOException {
        ListIterator iter = sessions.listIterator();
        while (iter.hasNext()) {
            SmbSession ssn = (SmbSession)iter.next();
            ssn.logoff( hard );
        }
        try {  // Ghisler: broken pipe lets this fail!
            socket.shutdownOutput();
        } catch (Exception e) {
        }
        out.close();
        in.close();
        socket.close();
        digest = null;
    } 
Author of Total Commander
https://www.ghisler.com
s.normal
Junior Member
Junior Member
Posts: 9
Joined: 2013-08-28, 07:59 UTC

Post by *s.normal »

hello I am using the lan-plugin 2.03
I have built a vpn-connection via 4g using Android 4.22.
After I tried to connect to my NAS via internal IP-Adress I received the following error Message: "failed to connect: 0.0.0.0<00>/192.168.178.1


When I am holding my finger on the LAN plugin on the home screen, I can't see the option which allows the connection via phone.

Maybe this funktion is not longer desired?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, otherwise the plugin would simply refuse to connect. The error means that the plugin found the IP address, but connection failed. Can you try the option "connect to older NAS"?
Author of Total Commander
https://www.ghisler.com
s.normal
Junior Member
Junior Member
Posts: 9
Joined: 2013-08-28, 07:59 UTC

Post by *s.normal »

I tried the option "connect to older NAS (LMv1) and received the same error Message.

Connecting via WLAN to my NAS with the same SMB-Config works fine.
FTP-Connection via VPN works also fine.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Could you use a tool like MyIP to check your current IP address on the device while the VPN connection is active? SMB only works when in the same subnet (192.168.178.* in this case).
Author of Total Commander
https://www.ghisler.com
mankokoma
Junior Member
Junior Member
Posts: 20
Joined: 2011-06-14, 08:46 UTC

Post by *mankokoma »

Got also often this "failed to connect: 0.0.0.0<00>/192....." message when trying to connect to Samba-Servers or Windows-shares...
My solution was to create TWO configurations per server - one with the IP and another with the HOSTNAME.
When the error message is appearing on HOSTNAME-configuration I click okay and switch to the IP-based or vice versa.

It's not how it's supposed to be but nevertheless it ALWAYS works this way.
s.normal
Junior Member
Junior Member
Posts: 9
Joined: 2013-08-28, 07:59 UTC

Post by *s.normal »

ghisler(Author) wrote:Could you use a tool like MyIP to check your current IP address on the device while the VPN connection is active? SMB only works when in the same subnet (192.168.178.* in this case).
On my Smartphone I see the following IP-Adress 10.134.212.xx during the VPN connection between Smartphone and NAS.

When I am using FTP via VPN I have the same IP-Adress 10.134.212.xx and the connection to the internal IP-Adress 192.168.178.xx works fine.

I think during the VPN-Connection to my Router it should be possible to reach my internal-NAS with the internal IP-Adress (192.168.178.xx). Same Procedure as FTP-Connection.

Maybe there are some differences?

best regards
stefan
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I don't think that this is possible. While FTP works fine between different subnets, the SMB protocol used by Windows does not.
Author of Total Commander
https://www.ghisler.com
s.normal
Junior Member
Junior Member
Posts: 9
Joined: 2013-08-28, 07:59 UTC

Post by *s.normal »

ghisler(Author) wrote:I don't think that this is possible. While FTP works fine between different subnets, the SMB protocol used by Windows does not.
VPN-Connection to my Router to connect to my internal-NAS via smb-protocol works fine with the app "ES Datei Explorer".
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

ES uses the same SMB libraries (JCIFS) as Total Commander. I do not see any reason why it should work with ES and not with TC.
Author of Total Commander
https://www.ghisler.com
s.normal
Junior Member
Junior Member
Posts: 9
Joined: 2013-08-28, 07:59 UTC

Post by *s.normal »

With the Total Commander I received the follow Message.

Translation in englisch:
No Internet connection. Please activate either WLAN or deactivate the flight-modus. Now turn on WLAN? --> Yes/No

If necessary I can also upload a screen-shot.[/img]
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

By default, the LAN plugin will only connect over direct LAN connections. To use it over VPN, tap on the settings line (with the hammer icon) and allow connections via phone.
Author of Total Commander
https://www.ghisler.com
s.normal
Junior Member
Junior Member
Posts: 9
Joined: 2013-08-28, 07:59 UTC

Post by *s.normal »

Thank you!
Now it works how I wish.

regards
Stefan
User avatar
Matzix
Junior Member
Junior Member
Posts: 14
Joined: 2004-03-29, 15:10 UTC

confirm: TC and ES behave differently

Post by *Matzix »

ghisler(Author) wrote:ES uses the same SMB libraries (JCIFS) as Total Commander. I do not see any reason why it should work with ES and not with TC.
I can confirm, that access via ES works, but not via TC. My setup: Android is on private adress range (10.0.xx.xx, UMTS O2), VPN connection using NAT translation via Fritz!Box (local adress 192.168.11.2xx) to QNAP NAS 192.168.11.yy

In TC I receive the error message
"failed to connect: 0.0.0.0<00>/192.168(...)", with ES I can connect and my NAS tells in the log that a connection has been established from private address 192.168.11.2xx using SAMBA and computername is jcifs_0_1_4d

I do not know how to track down what's different between both calls, but maybe someone can give me hint on how to achieve this.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, no idea what I could change. :(
You will have to use ES.
Author of Total Commander
https://www.ghisler.com
Post Reply