How do I make my Server use the correct outbound Gateway when using a multi-WAN router?

Hello everyone,

So I guess the title should already give a pretty good idea of what my challenge will be. I am currently in the process of getting a second internet-connection at home which will have much better upload-speeds and therefore I want to make sure that Plex always uses this as its outbound Gateway.

For clarification, I have an existing landline connection with 30Mbit down and 4MBit up (WAN1) which will soon be complemented by an LTE connection with theoretical maximum speeds of 150MBit down and 50MBit up (WAN2) which will eventually be getting a static IP which I would hope should make things easier telling Plex to have my plex.tv hostname point to the right address (WAN1 does not and will not have a static IP). I have already set up and successfully tested my TP-Link TL-ER5120 V2.0 with a USB-Modem attached to a Raspberry Pi but only to see that I can use 2 WAN connections simultaneously without the users on the local network being able to tell the difference.

The router I linked has the ability to make outbound connections take a certain gateway (“Policy Routing” see attached screenshot) depending on Source/Destination-IP, Source/Destination-Port or Protocol used (TCP/UDP/etc.). So herein lies my main question to Plex-Staff or whoever has intricate enough knowledge of the subject-matter: What does a typical communication between my Plex Media Server and Plex look like when it is “phoning home” to keep Plex updated about my current IP-Address? Because I don’t think closing down my 3240X ports on WAN1 will solve the problem if my server(s) keep(s) trying to tell Plex that WAN1’s address is my address. Either the solution will lie within the answer to that question or maybe there is a way for me to tell Plex to just use my WAN2 static IP for eternity? That would take the multi-WAN router completely out of the equation and probably be an even better solution but as far as I know there is no way to set up a static IP in Server Settings or anywhere else.

Thanks in advance for any and all replies

I don’t think you will be able to use Plex remote access over LTE.
LTE normally doesn’t allow port forwarding, your public IP address will be not unique to you (corporate NAT).

Unless your ISP offers some kind of ‘tunneling’ which makes you appear towards the internet as having an own, public IPv4 IP address.

Which ISP is it and under which name is the product marketed?

I am not asking whether it will be possible to stream over WAN2. The ISP is called “Drei” here in Austria, in other parts of the world it might be known as “Three” or “Huchison 3G”. I know that I can use this LTE router (Huawei E5186s to be exact) that they will send me to have all ports open to the outside world and use it like any other ordinary internet-connection. This offering is intended to be used as a stationary internet-connection (even though of course you could technically drive around with it) and therefore they are in direct competition with other ISPs providing internet over cable, landline or whatever.

But I digress. My question is not whether this will be possible, we might as well even ignore the fact of what technology WAN2 will be using. All I want to know is how I can make sure that my plex.tv hostname will point to the desired IP address so that anyone using my Plex server from the outside will be accessing it through WAN2 benefiting from the higher upload speeds.

just policy route anything with the source IP of your Plex server via the LTE modem.

Either by taking WAN1 away in general from your Plex server. (in the network adapter settings)
or by using some other workaround:

There is currently no means to deal with multiple gateways built into Plex.

@trudge yes that would theoretically be possible but there are 2 obstacles I see (and I will report back with my findings once I have been able to test it all out) for one the Plex server is behind another router (yes that’s essentially triple-NAT before anything reaches a client in my home for those who are counting) so I don’t know whether i can even use the IP of the plex server - which is in a different subnet - as the source IP and secondly, the Linux which Plex is running on doesn’t just do Plex it does many services, not all of which I necessarily want to be going strictly through WAN2 (LTE). If I don’t find a better solution however it’s definitely worth having a look at.

@OttoKerner thanks for sharing the link, unfortunately the two WANs aren’t distinguishable as separate NICs or something like that, which is the whole point of a multi-WAN router so that the clients can’t tell the difference and the router does all the work so that concurrent connections always use the same gateway as to maintain integrity of all communication.

I don’t necessarily want Plex to be able to handle this exotic situation that I will have going on, I know this is not your everyday typical issue so it would probably be a waste of manpower to give it attention on the development-side of Plex. All I really want to know is whether there’s a way to have all Plex-related traffic coming from INSIDE my network to go through a specific gateway. Maybe there’s a specific port that my Plex Media Server will connect to when it talks to Plex’ servers or maybe it connects to a certain IP or a set of IPs so that I could narrow down the traffic that way.

Either way I think what isn’t such an exotic issue is having a static IP and wanting to just tell Plex to ALWAYS use that IP no matter what. I think there should be quite a few people out there rocking a static IP and of course it doesn’t hurt anybody if Plex keeps checking for a change when there will never be one but I think it would still be a nice addition to the “Remote Access” section in the Server Settings to be able to just punch in a static IP and be done with it. Because theoretically I can of course just let people access my server over the static IP in the future but only when my plex.tv hostname points to the right IP will it be seamless and include the safety of the SSL certificate Plex are nice enough to provide.

Being able to put an IP address into Plex isn’t going to help you all that much. You can do the incoming anyway with existing functionality, setup a DNS domain, point it at the LTE static, then use the custom URL field list to publish that domain name to Plex.

That would help control the inbound path to your server, it won’t do anything for the outbound path - that you need to control with routing. For the outgoing, ideally you would want a seperate 1:1: static NAT setup for your server at the first router to enable a unique IP address for it to hit the 2nd router - but you are going to need somewhat advanced equipment in place to do that.

Plex is like an other app in that it uses random source ports as per your OS config. So defining it as a source at the port level is going to be impossible.

OK so I just found out about the “Custom server access URLs” again, which I am already using but I don’t know exactly what it does to be honest. I don’t have an SSL certificate for this domain that I entered in that field so I’m guessing that that would force people to “Reload app insecurely” as it is called in the web-app. But what does that even mean when this custom URL is being published to plex.tv? I think your answer might be the solution (and I will mark it as such once I’ve actually got everything up and running) but still I’m not quite sure whether this custom URL field will help me always having people from outside go through the faster LTE static IP.

In the interest of completeness I shall share the result of my findings here after posting about the same issue in the Plex Pass subforums. Forum user sica has confirmed to me that

PLEX server connects to plex.tv via a HTTPS connection (Port 443) on startup and in regular intervals

So to achieve the desired result one would have to route all traffic going towards “plex.tv” or its respective IP addresses and/or towards port 443 through one specific WAN connection in order to have a Plex-server always appear to the outside world on that interface.

I can hereby confirm that this works.

@desentizised said:

I can hereby confirm that this works.
Kicking this up because I will have a similar situation soon, in this case in France (ISP is Orange): a DSL landline with a miserable 0.7 Mbit upload (WAN1), augmented by a 4G router (the “AirBox 4G” aka Huawei E5573) with a very usable 12 Mbit upload (WAN2). Plex Media Server is running on a Mac.

Am I correct in that on this Mac, I have to static route all traffic to plex.tv via the AirBox, with something like this?
route add -host <ip of plex.tv> <ip of AirBox>

Sorry for the late reply. I don’t know the exact syntax of the route command off the top of my head but I guess you do so other than that, yes that is what you would need so that your Server advertises itself to Plex over the 4G Router so that anyone who tries to access from the outside will be sent in through the AirBox.