Force specific LAN to use as external access

Server Version#: 1.21.2.3939 (Latest)
Player Version#: (Latest on all) Not really relevant to my question

Is there a way to force Plex to prioritise all external traffic over a specific LAN as my Plex server has two LAN connections on two different subnets and two different external IP addresses through two separate ISPs. There is a setting in the server to “prefer specific lan” but this states only to local users and external clients are just using their logins to access my Plex.

The one line has 1gb upload and the other only has 120mb upload … hence wanting it to prioritise the 1gb connection to external clients?

Thanks

There are at least a couple of ways you could approach this, but the simplest is likely to configure the interface metrics of your network adapters such that the interface with the higher upload speed is chosen for outbound connections(*). You can do this by assigning a lower (higher priority) interface metric to the appropriate interface. This article describes how the automatic metric value is chosen; the very bottom of the article shows how to disable the automatic metric and manually assign one:

You can see what Windows has automatically assigned for interface metrics using the route print command.

*This may seem unintuitive, but the interface used for the outbound connection to Plex, Inc.'s servers determines which WAN IP address is used for inbound connections.

Thanks for the reply but I already have the 1gb line with a metric of 1 and the other as a metric of 9999 but some external clients still seem to come through the other line?

When did you make the change? If it was done recently it may take time for the new connection information to propagate to clients. Is it possible that the clients not connecting through the preferred interface are using cached connection information?

Unfortunately the adapters have been set that way from the start. So couple of years. Only noticed recently because of people trying to stream 4k content which doesn’t work over the 120mb up connection. But works fine over the 1gb up one.

If you browse to canyouseeme.org, does it show the proper public IP address?

In your remote access settings:

  • Does it show the correct private IP address?
  • Are you manually specifying the public port?

That second point is important. If you don’t manually specify a public port PMS will attempt to configure port forwarding automatically on your router(s) using UPnP/NAT-PMP. This may affect remote connections as well. Of course, if you manually specify a port here, you’ll need to manually configure the port forwarding rule on your router.

It does show the default public IP of the 1gb connection, which is the metric 1 connection, and I have UPNP turned off on the router and am manually assigning 32400 to Plex and port forwarding that on the router.

Although I also have that port forwarded on the other ISP too as I want the redundant line to still be able to hit my Plex server on the second LAN.

Interesting. Try browsing to this address to see what IP addresses it has listed for your servers:

https://plex.tv/api/resources?X-Plex-Token=plex_online_token

Replace “plex_online_token” with your token . You can also find your token in the Windows Plex registry key (HKEY_CURRENT_USER\SOFTWARE\Plex, Inc.\Plex Media Server

This will show the connection information published to Plex for your server. Does it list both of your public IP addresses?

2 Likes

Windows used to do weird things if adapters (which have metrics) & routes (which also have metrics) had identical total metric scores. I haven’t tried in the last few years.

What do the metrics look like in your routing table? route print


Following the thread, because I assume Plex won’t register every available address with the Plex Cloud, because this is an unusual configuration. But I’m curious. :slight_smile:

2 Likes

I am, too. I’m almost positive I participated in a thread where there was a similar (the same?) issue, and that it was resolved by changing the metrics. I’m interested to see if PMS is publishing both public IP addresses.

That would be weird as heck, actually. It would imply that Plex was ignoring metrics and routing rules and bypassing OS-layer stuff.

So, you know, maybe. :man_shrugging: :slight_smile:

Strangely I only ever get the correct public IP showing in that XML:

<MediaContainer size="5">
<Device name="NAS" product="Plex Media Server" productVersion="1.21.2.3943-a91458577" platform="Windows" platformVersion="10.0 (Build 19042)" device="PC" clientIdentifier="a8b0a70482718876adf608ac0d29541f2b1f6e87" createdAt="1610897894" lastSeenAt="1611767750" provides="server" owned="1" accessToken="xxxxx" publicAddress="1xxxxxxx.122" httpsRequired="0" synced="0" relay="1" dnsRebindingProtection="0" natLoopbackSupported="0" publicAddressMatches="1" presence="1">
<Connection protocol="http" address="10.0.1.113" port="32400" uri="http://10.0.1.113:32400" local="1"/>
<Connection protocol="http" address="1xxxxxx.122" port="32400" uri="http://1xxxxxx.122:32400" local="0"/>
</Device>
<Device name="SM-N986B" product="Plex for Android (Mobile)" productVersion="8.12.1.22702" platform="Android" platformVersion="11" device="SM-N986B" clientIdentifier="d2e7ce5e4b40e3b2-com-plexapp-android" createdAt="1608933948" lastSeenAt="1611770351" provides="player,pubsub-player,controller,sync-target" owned="1" publicAddress="3xxxxxx.204" publicAddressMatches="0" presence="0">
<Connection protocol="http" address="10.0.1.200" port="32500" uri="http://10.0.1.200:32500" local="1"/>
</Device>
<Device name="Google TV" product="Plex for Android (TV)" productVersion="8.11.0.22186" platform="Android" platformVersion="10" device="Chromecast" clientIdentifier="81621a128384895a-com-plexapp-android" createdAt="1609263059" lastSeenAt="1611777725" provides="player,pubsub-player,controller" owned="1" publicAddress="1xxxxxxx.122" publicAddressMatches="1" presence="0">
<Connection protocol="http" address="10.0.1.188" port="32500" uri="http://10.0.1.188:32500" local="1"/>
</Device>
<Device name="Beast" product="Plex Media Player" productVersion="4.29.6" platform="Konvergo" platformVersion="2.58.0.1076-38e019da" device="Windows" clientIdentifier="gr1frpm3v4e3h4kmk8mh1tt9" createdAt="1610523770" lastSeenAt="1611781223" provides="client,player,pubsub-player" owned="1" publicAddress="1xxxxxxx.122" publicAddressMatches="1" presence="0">
<Connection protocol="http" address="10.0.1.150" port="32433" uri="http://10.0.1.150:32433" local="1"/>
<Connection protocol="http" address="10.0.2.150" port="32433" uri="http://10.0.2.150:32433" local="1"/>
</Device>
<Device name="Chrome" product="Plex Web" productVersion="4.51.1" platform="Chrome" platformVersion="87.0" device="Windows" clientIdentifier="w4f41ga53j8fz435vgha0tfk" createdAt="1611194590" lastSeenAt="1611779725" provides="client,player,pubsub-player" owned="1" publicAddress="1xxxxxx.122" publicAddressMatches="1" presence="1" accessToken="xxxxx">
<Connection protocol="http" address="10.0.1.113" port="32400" uri="http://10.0.1.113:32400" local="1"/>
<Connection protocol="http" address="1xxxxxx.122" port="32400" uri="http://1xxxxxx.122:32400" local="0"/>
</Device>
</MediaContainer>

Blanked out for privacy but always the .122 public IP apparently. But this is not the case as sometimes the traffic for external users is going through my other line which is 10.0.2.113 locally and ending .193 publicly.

1 Like

This, to me, implies that the clients are likely using outdated connection information. Perhaps they haven’t checked in with the mothership in a while. I’m curious what the result would be if you removed/disabled the port forwarding rule on the second router. Maybe it would force clients to refresh their connection info if they were unable to connect? And/or sign out one of the affected clients and sign in again (or uninstall/reinstall the Plex app)?

At the very least, the expected information is being published to Plex.

2 Likes

Keep the resources URL handy, and check it the instant you see traffic taking the other path.

The PMS logs might be also be interesting in that moment, especially if you see Plex registering via the other interface/address.

2 Likes

I think I might try this by disabling the secondary LAN for a little while and let all clients use the other connection and see if that helps.

Unfortunately some clients have old Samsung Smart TVs with no updates to the Plex client for a long time. The features in the settings for the TV app are limited client end.

I will report back findings after I have tried

2 Likes

you can remove all the client connections and force them to log in again once you have made the change.

When I was having the same issue I use a freeware program to bind plex to the one IP address.
the route commands will not help you unless you want to kill all traffic going out the slow lan, as the route command is dealing with TCP connections, not applications.
here is the program I used. I put it in the same directory then edited the service start line to start with the proper command.
https://www.howtogeek.com/117890/how-to-force-an-application-to-use-a-specific-network-card/

Thanks everyone.

Getting the clients to sign out and sign back in, after disabling the 2nd LAN connection and restarting Plex Media Server with it disabled, worked like a charm.

Seems Plex was just stuck on connecting through the second LAN.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.