Help with IP binding, when I have a VPN installed

Need help? Post your questions here.

Moderator: moderators

Help with IP binding, when I have a VPN installed

Postby WACOMalt » Tue Aug 13, 2013 6:20 pm

Hi there. fist of let me explain my situation.

I am running Subsonic 4.8 (3434) on Windows 8 (but this behavior also happened to me on Windows 7 with the same setup)
I have a VPN set up using COMODO Unite (basically the exact same thing as Hamachi, gives you a network adapter with a different IP to connect to the Virtual Network)

I am trying to access Subsonic from WITHIN my local network (aka 192.168.1.XX), which is not working, but outside of my network it works fine. I can easily test this on my Android phone by disabling Wifi so it goes over the cell network. When on WiFi it times out.

I discovered that the issue I am having is that from inside my network, myusername.subsonic.org is pointing to the IP address of my computer on my VPN, not my IP of my real netowrk. So, simply put, I need to tell subsonic to bind to my LAN IP address (192.168.1.XX), not my VPN IP address (5.6.104.XX) I have further cunfirmed this to be the issue by temporarily uninstalling the VPN adapter. When I do this Subsonic binds to the LAN address, and everything works perfect.

So the question is, how can I tell Subsonic which IP to bind to?


EDIT: Ok, so I did some digging. Still a no-go. But what I tried was editing "subsonic-service.exe.vmoptions" in C:\Program Files (x86)\Subsonic to set the host to my LAN IP address. This did change one thing, which is that in the subsonic control panel it now shows http://192.168.1.XX:4040 as the address instead of http://localhost:4040

Now if I type http://myusername.subsonic.org in my browser, it still points to the VPN IP, but nothing loads. This at least means the subsonic itself is no longer listening on the VPN IP address, so that's good, but, the xxxxx.subsonic.org name is not being registered to the same IP that subsonic server is bound to, and for some reason is still registering as my VPN IP. Getting close, all I need to do is successfully register my subsonic address now.

EDIT: Also, sorry I have no idea how this got triple posted O_o I only clicked submit once. Sorry about that though, I deleted the other two.
WACOMalt
 
Posts: 22
Joined: Fri Oct 12, 2012 3:55 am

Re: Help with IP binding, when I have a VPN installed

Postby gurutech » Wed Aug 14, 2013 1:38 am

I have the same issue. Inside my network, my xxxxxxxx.subsonic.org domain goes to the IP of whichever computer I'm on at the time, NOT the computer running Madsonic.

The only way around this is to set up a No-IP or DynDNS address and use that instead.
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Help with IP binding, when I have a VPN installed

Postby WACOMalt » Wed Aug 14, 2013 5:20 pm

That's pretty rediculous. Subsonic should register the IP to which is is bound. There is no reason for the current behavior.

There's seriously not a way around this? I really dont understand why it would register on my VPN IP as that is literally not used for anything... at all. blargh. Can this be filed as a bugreport?

OK, here's a question. As a workaround, is it possible to manually tell subsonic to register it's myname.subsonic.org name? IF so my plan is as follows:

Create a Batch file that will run on startup
-Disable the VPN network connection entirely via command prompt
-Invoke Subsonic to register its address (when VPN is disabled it registers the proper lan IP)
-Enable the VPN network connection

so far I have found the VPN adapter ID via command prompt:
Code: Select all
wmic nic get name, index

so then these commands will disable and enable

Code: Select all
wmic path win32_networkadapter where index=21 call disable
??? what goes here to tell subsonic to register ???
wmic path win32_networkadapter where index=21 call enable


I dont care if I have to create a script that actually opens a browser, logs in, goes to the network page, and clicks save. I need to get this working or Subsonic is now useless to me. Any ideas?
Last edited by WACOMalt on Wed Aug 14, 2013 5:34 pm, edited 1 time in total.
WACOMalt
 
Posts: 22
Joined: Fri Oct 12, 2012 3:55 am

Re: Help with IP binding, when I have a VPN installed

Postby daneren2005 » Wed Aug 14, 2013 5:26 pm

I dont understand. How is Subsonic supposed to know what the LAN IP is when it is connecting over the VPN IP? That is the address presented to the program.

Sent from my HTC One X using Tapatalk 2
Developer of DSub for Android
daneren2005
 
Posts: 1709
Joined: Fri Jul 06, 2012 7:52 pm

Re: Help with IP binding, when I have a VPN installed

Postby WACOMalt » Wed Aug 14, 2013 5:41 pm

Subsonic ISNT connecting via VPN. The VPN in this scenario is not at all intended to have anything to do with Subsonic.

Think of it like this, I'm sitting at home, on my LAN. My server is on my localhost, on the lan, and running. Completely unrelated I have a VPN connection for folder sharing between a relative of mine who is a ways away and not on our network. So I have a VPN for that file sharing.

Back at home, here I am typing wacomalt.subsonic.org to get to my server, when it points to 5.4.10.XX:4040/index.view Which is my machine's VPN address. So I edit my vmsettings for subsonic and tell it to bind ONLY to 192.168.1.XX, my LAN IP address. Now when I type wacomalt.subsonic.org it stil points to the VPN address, but I get an error page, because subsonic isnt bound to that IP any more. Thats a step forward, but why is wacomalt.subsonic.org still redirecting to an IP that subsonic isnt even using?

through all of this, if I manually type in 192.168.1.XX:4040 it all goes fine.



So tl;dr: the VPN is not used at all for subsonic, and subsonic has explicitly been told to ignore this IP address, and the server does ignore it, but the domain registration doesnt.


SUBSONIC SERVER (192.168.1.10 on my LAN)

Inside my lan wacomalt.subsonic.org points to 5.6.104.139 which is an IP that is only used for VPN file sharing, and needs to be ignored. Manually typing 192.168.1.10:4040 works.
Outside my lan, the address is correctly Identified as 71.67.142.10:4040 Which is my network's external IP address.

so the only issue is inside my network wacomalt.subsonic.org should be pointing to the LAN IP, which is the IP the server is bound to in the vm settings. (subsonic-service.exe.vmoptions)
Last edited by WACOMalt on Wed Aug 14, 2013 5:52 pm, edited 1 time in total.
WACOMalt
 
Posts: 22
Joined: Fri Oct 12, 2012 3:55 am

Re: Help with IP binding, when I have a VPN installed

Postby WACOMalt » Wed Aug 14, 2013 5:45 pm

So in my searching, I have found the relevant line of the settings page that actually updates the domain. Now how to use this, I have no idea...

Code: Select all
        function updateStatus(networkStatus) {
            $("#portForwardingStatus").html(networkStatus.portForwardingStatusText);
            $("#urlRedirectionStatus").html(networkStatus.urlRedirectionStatusText);
            window.setTimeout("refreshStatus()", 1000);
WACOMalt
 
Posts: 22
Joined: Fri Oct 12, 2012 3:55 am

Re: Help with IP binding, when I have a VPN installed

Postby gurutech » Wed Aug 14, 2013 11:22 pm

You can edit your HOSTS file to point your subsonic.org name to the correct IP address. Windows and *Nix will check that first, then DNS.
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Help with IP binding, when I have a VPN installed

Postby WACOMalt » Thu Aug 15, 2013 2:18 am

gurutech wrote:You can edit your HOSTS file to point your subsonic.org name to the correct IP address. Windows and *Nix will check that first, then DNS.


Will that work for everything on my network? My phone is my main player, runs DSub on Android.
WACOMalt
 
Posts: 22
Joined: Fri Oct 12, 2012 3:55 am

Re: Help with IP binding, when I have a VPN installed

Postby gurutech » Thu Aug 15, 2013 2:55 am

you'd have to do that for each computer on your network (each one has its own hosts file). I don't think phones have a hosts file to reference though.

You can add it in, and if it doesn't work, just take it back out again, or comment the line out (the hosts file has some basic instructions in it).
Image
gurutech
 
Posts: 492
Joined: Sun Jan 15, 2012 9:56 pm

Re: Help with IP binding, when I have a VPN installed

Postby WACOMalt » Thu Aug 15, 2013 6:08 am

If it isn't network-wide, it's not a solution for me. I have done hosts file editing, but I need to solve this on the server machine itself. Is there no way to invoke an update of the subdomain registration?
WACOMalt
 
Posts: 22
Joined: Fri Oct 12, 2012 3:55 am

Re: Help with IP binding, when I have a VPN installed

Postby GJ51 » Thu Aug 15, 2013 6:55 am

This sounds more like a routing issue than a flaw in Subsonic. The fact that your site responds correctly from outside your network indicates that the redirection information passed to Subsonic.org is correct. That is, Subsonic is redirecting your vanity address to 71.67.142.10:4040 and that your router is correctly passing the request to the host properly.

The problem seems to be that internal requests for the vanity name are being incorrectly looped to the vpn ip. I've had VPN setups on my network from time to time and never ran into a conflict with Subsonic, which further tends to support this not being a Subsonic issue. I'm not sure but perhaps setting up a static route definition in the router would work?
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: Help with IP binding, when I have a VPN installed

Postby WACOMalt » Thu Aug 15, 2013 8:24 pm

Hmm that is a possibility. I was under the impression that when subsonic registered a name it sent two bits of info, the Local IP, and the external IP. If the redirection server saw that your request was coming from the same IP as the server's external IP (aka you are inside the same network) that the redirection server would send you back to the internal IP reported when registering. if your IP when requesting was different, then it assumes external traffic and sends you to the external IP address. If that is how it works, then it is the registration that is flawed.

I am not quite sure how an internal request to wacomalt.subsonic.org could possibly be sending me to a local IP without some sort of hosts file editing, or redirection on my router, neither of which I think subsonic sets up on its own.

In any case if this is how it works, than I need to figure out how to fix that.

What is odd, is back when I had Hamachi I never had this behavior, everything worked fine and subsonic ignored the VPN entirely. But with COMODO Unite, my current VPN software (because hamachi has stopped working entirely) subsonic will not ignore the VPN no matter what I do.

I guess my best option now is simply doing some sort of local redirection, or dumping Comodo and getting Hamachi to work again (tried that, many times), or setting something up on my router so that any local requests to the 5.4.106.XX or whatever range are redirected to 192.168.1.10. But I'm at a loss there.
WACOMalt
 
Posts: 22
Joined: Fri Oct 12, 2012 3:55 am

Re: Help with IP binding, when I have a VPN installed

Postby BKKKPewsey » Thu Aug 15, 2013 9:09 pm

WACOMalt wrote: I was under the impression that when subsonic registered a name it sent two bits of info, the Local IP, and the external IP.

No it doesn't it redirects back to your external IP:port_no only - all the rest of the magic (or not in your case :roll: ) is performed by your router.
Why don't you access SS directly via internal_IP:port_no within your own lan as they keeps the VPN and external internet traffic out of the equation.

:mrgreen:
Everyone is entitled to be stupid, Image but some abuse the privilege!

Due to the confusion from too many genres of music, we have decided to put both country music and rap music into the genre of Crap music.
User avatar
BKKKPewsey
 
Posts: 2080
Joined: Mon May 23, 2011 12:16 pm
Location: United Kingdom

Re: Help with IP binding, when I have a VPN installed

Postby GJ51 » Thu Aug 15, 2013 9:16 pm

This can be one of the most confusing topics in all of computing, and although I've studied it on and off for years, I'm by no means an expert. I do know that Subsonic.org redirection only records your external ip and port number. Your internal ip information is not sent. When you type in Vanityname.subsonic.org the request is routed via normal dns channels to Subsonic.org which then looks up the vanityname and looks in it's db to find the external ip and port number associated with the recorded vanityname and then redirects the request to your external ip:port number. Once the request is received at your router, port forwarding passes the request as per your port forwarding that you set up on your router. That's how the request gets to your internal ip address.

On most home networks DHCP and DNS are handled by the router. So typically, you have a local DNS cache on your workstation and the router itself has DNS cache. DNS works by finding the nearest correct available information that can handle the request. So if your on your workstation and the routing info is still in your local cache it just sends it to the right address, if not it passes the request to the router, if the router doesn't have the answer it gets passed to the nearest DNS server defined in the router (usually at the ISP) all the way up to the root DNS server if necessary.

Most modern routers have what is known as loopback capability. That is, when it sees a request (even an external address) that it recognizes as a previous request that loops back to an internal address, it just sends your right to the local address rather than sending the request out to the web and waiting for it to come back.

Not all routers do this, I'm told, but I've never had a router that didn't.

What it sounds like from your description is that your router is incorrectly sending the request to the VPN address. That sounds like a night with the router manual and internal admin router screens to me.

HTH


EDIT: OR - like PK said while I was typing :wink:

More info here:

http://bit.ly/128xcHE
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: Help with IP binding, when I have a VPN installed

Postby WACOMalt » Fri Aug 16, 2013 2:22 am

Well, using the local IP address:port limits me greatly on my other devices. Id have to have two separate servers added to my phone's app and laptop, and anything that would ever be outside of my network.

The VPN is set up locally on my computer, not through the router, so unless my computer is somehow reporting to my router that it is also in a VPN, then its seems odd that when that traffic gets back to my router that it would be sending it to me via that address.

So What is likely the case is that just on my local machine, it's cached resolution for "localhost", or my LAN IP, or whatever my router is telling it, is getting is getting translated to the VPN address. I have a veryt nice router so I assume it is possible to tall my router univerally to take any and all traffic to wacomalt.subsonic.org (from inside) to 192.168.1.10:4040

That sounds like the easiest and most full coverage approach. I really wish I knew what comodo does different from Hamachi. I never had this issue with Hamachi, but then Hamachi stopped being any good (no one could browse shared folders, and logmein support is nonexistent for their free products) so I guess I just have to deal with this issue that has been presented to me.
WACOMalt
 
Posts: 22
Joined: Fri Oct 12, 2012 3:55 am

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 17 guests