# Network - How to connect to a remote listening server

**URL:** <https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, Server, unreal-engine, Multiplayer, question\
**Created:** [June 6, 2014, 12:21am UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138 "2014-06-06T00:21:06Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![tatoforever](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tatoforever](https://forums.unrealengine.com/u/tatoforever)\
**Post date:** [June 6, 2014, 12:21am UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/1 "2014-06-06T00:21:06Z")

</div>

Hello guys,  
I got a small networking prototype (small scene with few replicated moving actors).  
I’ve made a development build and send it over to some friends to test multiplayer networking in UE4.  
I’m running the client and the server (listening mode) and my mates are trying to connect to through console (“open MyIpAdress”). The thing is that it only works locally (LAN), doesn’t seem to work remotely (outside our LAN).

Is there anything we need to do to test remote multiplayer networking outside LAN?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_753bceeb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_753bceeb](https://forums.unrealengine.com/u/anonymous_user_753bceeb)\
**Post date:** [June 6, 2014, 12:58am UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/2 "2014-06-06T00:58:30Z")

</div>

You need to open a hole in your router firewall and forward the appropriate port to your server, I believe the default is UDP 7777.

---

<div class="post-metadata">

**Author:** ![tatoforever](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tatoforever](https://forums.unrealengine.com/u/tatoforever)\
**Post date:** [June 6, 2014, 1:10am UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/3 "2014-06-06T01:10:28Z")

</div>

Hi,  
Isn’t that done automatically the first time we open the game?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6453503b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6453503b](https://forums.unrealengine.com/u/anonymous_user_6453503b)\
**Post date:** [June 6, 2014, 1:42am UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/4 "2014-06-06T01:42:37Z")

</div>

You must forward port 7777 (or port you entered in DefaultEngine.ini) on you router. Not on you PC. It’s named “Port Forwarding”. You must open input port on router, then client from the Internet can connect to you. There are two technics to do that programmaticaly from you game on your PC in local network: UPnP and NAT-PMP. Better practice - use combination of technics, e.g. when you router denied access to UPnP or doen’t have this, you can try use NAT-PMP. And opposite situation. This technics in combination cover about 96% routers. Other 4%… Well… You can display instruction screen (for manual port forwarding) in your game. 🙂

---

<div class="post-metadata">

**Author:** ![itsAcren](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/itsacren/32/1194653_2.png) [@itsAcren](https://forums.unrealengine.com/u/itsAcren)\
**Post date:** [June 6, 2014, 3:34am UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/5 "2014-06-06T03:34:40Z")

</div>

No, it’s on your router not your PC.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_753bceeb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_753bceeb](https://forums.unrealengine.com/u/anonymous_user_753bceeb)\
**Post date:** [June 6, 2014, 1:55pm UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/6 "2014-06-06T13:55:29Z")

</div>

What library do you use for UPnP and NAT-PMP ?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6453503b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6453503b](https://forums.unrealengine.com/u/anonymous_user_6453503b)\
**Post date:** [June 6, 2014, 2:16pm UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/7 "2014-06-06T14:16:19Z")

</div>

MiniUPnP for UPnP, libnatpmp (from [miniupnp.free.fr](http://miniupnp.free.fr)) for NAT-PMP. Create two additional ThirdParty for Engine… Their are small and crossplatform. Exactly what we needed.

---

<div class="post-metadata">

**Author:** ![tatoforever](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tatoforever](https://forums.unrealengine.com/u/tatoforever)\
**Post date:** [June 6, 2014, 6:00pm UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/8 "2014-06-06T18:00:09Z")

</div>

Got it working! For now, I’ve manually configured the router but will give it a look to miniupnp for integration later in the process! 🙂  
Thanks guys!

---

<div class="post-metadata">

**Author:** ![PenguinTD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PenguinTD](https://forums.unrealengine.com/u/PenguinTD)\
**Post date:** [June 8, 2014, 7:22am UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/9 "2014-06-08T07:22:16Z")

</div>

any chance that you can write a wiki howto for MiniUPnP?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6453503b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6453503b](https://forums.unrealengine.com/u/anonymous_user_6453503b)\
**Post date:** [June 8, 2014, 8:20am UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/10 "2014-06-08T08:20:16Z")

</div>

No chance. 🙂

Due:

- I’m not very familiar with English language.
- I’m doesn’t have much time for article writing.
- Integration of miniUPnP into UE4 takes less time that writing article about it.

Shortly, just go into ThirdParty folder and see how Epic does this.

1. Create folder for our new thirdparty module, named “MiniUPnP” for example.

2. I’m split up headers and libs into separate folders “include” and “lib”. In libs im insert static lib of miniupnp. Into include insert only headers.

3. Create miniUPnP.Build.cs. E.g. module defenition.

Now i’m develope only for Windows. In this module defenition must be platform dependecies also. “For linux-based systems you must use miniupnp daemon instead client” and another things like this.

Next just add module into your game Build.cs. Include headers, for example in game session or in global \*.h:

```
#include "ThirdParty/miniUPnP/include/miniupnpc.h"
#include "ThirdParty/miniUPnP/include/upnpcommands.h"
#include "ThirdParty/miniUPnP/include/upnperrors.h"

```

For examples of use see offical miniupnp demo sources. In common:

1. Search for all upnp-able devices in network.
2. Make sure that it’s a router. And it’s grant access to UPnP. And port not “alredy in use”. Increase port if needed.
3. Say router “map outside port xxx as inside port yyy for IP zzz in LAN by protocol UDP/TCP to time 0(infinity) seconds and name this hole as GameName”. Procedure SetRedirectAndTest.

Similiar actions for libnatpmp.

---

<div class="post-metadata">

**Author:** ![tatoforever](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tatoforever](https://forums.unrealengine.com/u/tatoforever)\
**Post date:** [June 8, 2014, 11:37am UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/11 "2014-06-08T11:37:23Z")

</div>

Thanks sigma for the heads-up! 🙂

PS: I really wish now this could be supported internally by UE4.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f6d34148](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f6d34148](https://forums.unrealengine.com/u/anonymous_user_f6d34148)\
**Post date:** [January 26, 2015, 9:21am UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/12 "2015-01-26T09:21:05Z")

</div>

In fact you can. It’s called UPnP and NAT-PMP,but you should change code to make it work. Port is opened until computer disconnects from net or router reboots or that port opened on another computer. It’s a good practice,so there is no problem on multiple computers are able to host game at different time(You can use different ports,which is even better practice)

---

<div class="post-metadata">

**Author:** ![dMsLT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dMsLT](https://forums.unrealengine.com/u/dMsLT)\
**Post date:** [January 13, 2020, 1:36pm UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/13 "2020-01-13T13:36:13Z")

</div>

It’s easy you setup a BP running create server and join server nodes and pass the right parameters.

---

<div class="post-metadata">

**Author:** ![muhammadammar](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@muhammadammar](https://forums.unrealengine.com/u/muhammadammar)\
**Post date:** [July 16, 2021, 12:28pm UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/14 "2021-07-16T12:28:07Z")

</div>

Did Anyone find out how to do this mini UPnP integration with unreal engine, plz tell me I cant do it for my game.

---

<div class="post-metadata">

**Author:** ![keanenwillemse](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@keanenwillemse](https://forums.unrealengine.com/u/keanenwillemse)\
**Post date:** [January 3, 2023, 1:38pm UTC](https://forums.unrealengine.com/t/network-how-to-connect-to-a-remote-listening-server/285138/15 "2023-01-03T13:38:43Z")

</div>

How do you setup a bp to connect players globally
