Jump to content

Indicate external IP


Recommended Posts

LeidenSpain
Posted

Hi,

I've run into a problem (because of my router), that when I connect from outside my network, it appears in emby as if it were a connection from my router's IP (obviously local).

I am clear that it is a problem caused by my router, which did not happen before updating.
But this has made me think of an option for the network that I think could be very interesting.

Just as there is a section where we can indicate the IPs for the local network, and the IP of the emby server, I think it might be interesting to add the possibility of indicating an IP or an IP range so that emby considers it outside the network.

Regards,

Posted

Hi, are you using a reverse proxy?

LeidenSpain
Posted

Hi,

 

Yes, NPM (nginx proxy manager)
But suspecting that it could be that, I have opened the port of the router to have a direct access to emby, and it continues indicating that the access is the IP of the router.

Posted (edited)
3 hours ago, LeidenSpain said:

Hi,

 

Yes, NPM (nginx proxy manager)
But suspecting that it could be that, I have opened the port of the router to have a direct access to emby, and it continues indicating that the access is the IP of the router.

It would do, as that's what emby sees as initiating the connection - and it's correct to do so.

You need to add the nginx config in the 'location' section below - this will then forward the real WAN IP to emby ..

location / {

.....

proxy_set_header X-Real-IP $remote_addr;  ## Passes the real client IP to the backend server.
#proxy_set_header X-Real-IP $http_CF_Connecting_IP;  ## if you use cloudflare un-comment this line and comment out above line.
proxy_set_header Host $host;  ## Passes the requested domain name to the backend server.
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;  ## Adds forwarded IP to the list of IPs that were forwarded to the backend server.

.....

 

There is a large nginx setup thread here with the full config if you need it -

 

Edited by rbjtech
  • Thanks 1
LeidenSpain
Posted

As I was saying, that didn't happen to me before I updated the router (which I have to fix). But if I connect without going through the proxy, the problem is the same.
The same is happening to me with other services (such as home assistant).

I only propose as an idea, to be able to indicate to emby that a certain IP (or a range) belongs to the external network, so that the IP of the router can be excluded from the local network.

Cheesegeezer
Posted
5 hours ago, LeidenSpain said:

As I was saying, that didn't happen to me before I updated the router (which I have to fix). But if I connect without going through the proxy, the problem is the same.
The same is happening to me with other services (such as home assistant).

I only propose as an idea, to be able to indicate to emby that a certain IP (or a range) belongs to the external network, so that the IP of the router can be excluded from the local network.

How emby do that when your external ip is already recognised as an internal(local) IP.

I remember there were about 4 prefixes emby used to lookfor establish if it was local and that was … starts with- 192, 10, 172, and something else. But not sure if thats the case anymore.

  • Like 1
Posted (edited)
13 minutes ago, Cheesegeezer said:

How emby do that when your external ip is already recognised as an internal(local) IP.

I remember there were about 4 prefixes emby used to lookfor establish if it was local and that was … starts with- 192, 10, 172, and something else. But not sure if thats the case anymore.

Correct - non RFC1918 addresses are classed as 'remote' unless specified in the Network Setting in Emby  - but I think maybe the issue here is emby does not forward the X-Real IP header web request itself.  So if you are 'routing' internally (as I do, across VLAN's for example) then emby actually just sees the client IP as it's local gateway address, not the 'real' (local) address.

It's never bothered me as it's the local lan - but if it happening on the WAN side, I suspect it's the RP config or router config.

Edited by rbjtech
LeidenSpain
Posted

Yes, it's my router.

The same, with the old firmware version, this was not happening.

 

But leaving aside the reason that the remote connections appear with the IP of the router (which is not an emby thing), I am just commenting that it could be interesting to be able to indicate a specific IP as external, even if it is in the local range.

Apart from this case, it can be used to test the configuration of the users (now I do it by connecting to the mobile).

 

Regads

Cheesegeezer
Posted
4 hours ago, LeidenSpain said:

Yes, it's my router.

The same, with the old firmware version, this was not happening.

 

But leaving aside the reason that the remote connections appear with the IP of the router (which is not an emby thing), I am just commenting that it could be interesting to be able to indicate a specific IP as external, even if it is in the local range.

Apart from this case, it can be used to test the configuration of the users (now I do it by connecting to the mobile).

 

Regads

No worries, but how your external IP is internally shown from the local network isn’t something that emby can interpret. 
is the questionable IP in the same local ip prefex? 
 

you should blacklist IP’s on your router.

btw…  I’m not affiliated at all with emby… but, personally i don’t think its fair to ask emby to invest resources into something that isn’t their issue.

networking isn’t clear cut in code, believe me! And it opens up lots of other unforeseen issues that then need to be handled.

LeidenSpain
Posted

Hello again,

The same is that it was not explained to me well, since what I was proposing was not managing networks or anything like that.
As by default, emby can know the IP of the computer where it is working, but there is a section where we can manually indicate the IP of the emby computer. The idea was to have a box where it could be indicated that a certain IP should be considered as an external IP.

As I mentioned, I have different configuration for the users, some appear in the local network and others when they are external users.
And so far, to be able to do the tests, I have to connect to the mobile, since when I'm at home, I can't test that an external user has the configuration I want (if I'm on the same network as emby, it will always be all connections local).

It was just that, the possibility of being able to set an IP, that even if it is within the range of the local network (192.168.1.x), set a certain IP so that it is considered external. It would allow user configuration tests.

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...