Jump to content
daschef

Option to set IP as external

Recommended Posts

daschef

Hi,

 

i am using VPNs to access Emby. Unfortunately some VPN clients get IPs inside the servers range and are treated as local, so no bandwith throttling occurs.

There is the option to set local networks, but the server's subnet is always treated as local.

 

An option to set IPs or IP ranges always as external would help a lot!

 

Thanks!

Share this post


Link to post
Share on other sites
cayars

Why?

Why would you want to do this?  VPNs at best hide your identity from those without the power to figure out who your are (your IP).

If you turn around and tell them "this is my server" and here's an app for accessing it then what are you hiding? Surely not your identity anymore.

 

The VPN will do no good for your Emby server and just get in the way adding latency to every packet sent as well as slow down your overall throughput.

 

I'm not saying you don't have a need for a VPN for other purposes but you should run it on a different machine or VM then where Emby runs.

Share this post


Link to post
Share on other sites
daschef

I am using different vpns to access my emby server over the internet.

 

I have no problems with an OpenVPN server and a Strongswan server on the emby machine (access is treated as external).

 

Unfortunately i also use the OpenVPN server on a Synology device on the internal network. OpenVPN on Synology does IP masquerading, that means that access over this VPN seems to come from the Synology for the emby server.

 

All i want is to treat the IP of the Synology as external, so the bandwith throttling applies.

 

I do not use public VPN services like nordvpn etc.

Edited by daschef

Share this post


Link to post
Share on other sites
cayars

Got ya.  The easy fix if possible is change the IP range used on the Synology device so it doesn't look like an internal IP.

There might be a better way that also easier.

 

What are the different IP ranges being used internally on your network (normal and VPN)?

Share this post


Link to post
Share on other sites
Luke

If you set the local network, then anything outside of that will be considered external.

Share this post


Link to post
Share on other sites
daschef

Hi Luke,

 

sorry that is not true.

My network is named 172.16.128.0/24

 

If i set the local network to 172.16.128.0/25, only the IPs 172.16.128.1 to 172.16.128.126 should be local for emby.

 

The logs show this:

Info App: RemoteClientBitrateLimit: 2500000, RemoteIp: 172.16.128.200, IsInLocalNetwork: True

The Test Movie plays direct with 7 MBits.

 

I think emby treats its own network always as local.

Edited by daschef

Share this post


Link to post
Share on other sites
daschef

Here you get the screens and logs.

5bb526b6b9700_2018100322_26_33YourNameGe

 

5bb5270df0139_local.png

 

at 22:09 a Friend used emby over VPN:

Info App: RemoteClientBitrateLimit: 2500000, RemoteIp: 192.168.66.27, IsInLocalNetwork: False

Bandwith throttling was active.

embyserver.txt

Edited by daschef

Share this post


Link to post
Share on other sites
Luke

If the remote IP is 192.168.66.27, then it is correctly being detected as out of network, right?

Share this post


Link to post
Share on other sites
cayars
@@Luke, no idea if you wrote the code to check/calculate the subnet masks and what is considered local or not but if it's part of a library someone else wrote it could be flawed.  I've seen

 

10.0.0.0 to 10.255.255.255

172.16.0.0 to 172.31.255.255

192.168.0.0 to 192.168.255.255

 

always report "local" regardless of IP/mask given.  That of course is true they are private addresses but may not be "local".  Anyway, just thought I'd mention it in case you wanted to take a quick look to see how it's implemented.

Share this post


Link to post
Share on other sites
Luke

Anything in private address space we do assume local, yes.

Share this post


Link to post
Share on other sites
cayars

That's his problem then since Emby isn't respecting the IP/mask he set.  Look at the address space he is using in #6.

Edited by cayars

Share this post


Link to post
Share on other sites
daschef

but 192.168.66.27 was detected as external ...

Share this post


Link to post
Share on other sites
cayars

but 192.168.66.27 was detected as external ...

And it should be if you have:172.16.128.0/25

192 vs 172 C block

 

I'm not sure how Emby is coded but if you remove the 172.16.128.0/25 then Emby may use all the private address spaces as local and then this IP would be considered local.  But you over road what Emby normally considers local.

 

If you want the 172.16.66.xx range to also be local then add this to the list of your local networks.

Edited by cayars

Share this post


Link to post
Share on other sites
Luke

Thanks cayars. @@daschef does this help?

Share this post


Link to post
Share on other sites
daschef

Hi Luke, not really, with 172.16.128.0/25 as local net, 172.16.128.254 is still treated as internal ...

Share this post


Link to post
Share on other sites
RobWayBro

Actually, I suspect using /25 does not include .254  Are you really dividing your network?  If not, maybe try /24 which will include all 255 ip addresses.  With /25 sets the host max to .126

Share this post


Link to post
Share on other sites
daschef

Hi RobWayBro, that is exactly what i want. I want that 172.16.128.254 excluded from the local net.

Share this post


Link to post
Share on other sites
cayars

Hi Luke, not really, with 172.16.128.0/25 as local net, 172.16.128.254 is still treated as internal ...

That's incorrect.  It should be external based on /25.

172.16.128.1 - 172.16.128.126 would be internal IPs with that mask.

 

For anyone sort of following but not sure, just use an online calc like this one: http://www.subnet-calculator.com/

 

@daschef what exactly are you trying to accomplish?  Maybe we can help with another simple way to accomplish it.

Edited by cayars

Share this post


Link to post
Share on other sites
daschef

again:

 

- my net here is 172.16.128.0/24

- i want to accomplish that 172.16.128.254 is OUTSIDE the local net for emby, so bandwith throttling occurs

- setting the local net in emby to 172.16.128.0/25 does not help, 172.16.128.254 is still treated as internal ip

Share this post


Link to post
Share on other sites
Luke

Did you try /24 as suggested here?

Share this post


Link to post
Share on other sites
daschef

sure, but in /24 172.16.128.254 is included ....

Share this post


Link to post
Share on other sites
Luke

So why not use /24?

Share this post


Link to post
Share on other sites
daschef

because with /24 172.16.128.254 is internal and i don't want this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...