Skip to content

Instantly share code, notes, and snippets.

@Nachlor
Last active October 12, 2025 10:20
Show Gist options
  • Save Nachlor/fdf2a5f9de1c14aecfc4c8617401a2f3 to your computer and use it in GitHub Desktop.
Save Nachlor/fdf2a5f9de1c14aecfc4c8617401a2f3 to your computer and use it in GitHub Desktop.
Lanemu P2P VPN LAN Gaming

Lanemu P2P VPN LAN Gaming

Table of Contents

Preparations (Linux)

Preparations (Windows)

  • Disable SSDP Discovery
    • Open Control Panel
    • Click System and Security
    • Click Administrative Tools
    • Open Services
    • Right click SSDP Discovery and select Properties
    • Click Stop
    • Startup type: Disabled
    • Click Apply and OK
  • Enable DirectPlay and Media Features
    • Open Control Panel
    • Click Programs
    • Click Turn Windows features on or off
    • Expand Legacy Components
      • Check DirectPlay
    • Check Media Features
    • Click OK
  • Allow DirectPlay and game through Windows Firewall
    • Open Control Panel
    • Click System and Security
    • Click Allow an app through Windows Firewall
    • Click Change settings
    • Click Allow another app
    • Click Browse
      • DirectPlay
        • Go to C:\Windows\SysWOW64
        • Select dplaysvr.exe and click Open
      • DirectPlay 8 (x32)
        • Go to C:\Windows\System32
        • Select dpnsvr.exe and click Open
      • DirectPlay 8 (x64)
        • Go to C:\Windows\SysWOW64
        • Select dpnsvr.exe and click Open
      • Game
        • Go to game directory
        • Select game executable and click Open
    • Click Network types
      • Check Private and Public
      • Click OK
    • Click Add
    • Click OK
  • Optional recommendations

Usage

  • Get the latest Lanemu release by clicking Download under Packages
  • Extract the downloaded Lanemu archive to a new folder called Lanemu
  • Navigate to the OpenJDK page by clicking "Ready for use" JDK version
  • Download OpenJDK
  • Extract the downloaded OpenJDK archive to Lanemu -> build folder
    • Rename the extracted OpenJDK folder to jdk
  • Windows : Install Lanemu network adapter
    • Navigate to Lanemu -> driver folder
    • Right click add_adapter.bat
    • Click Run as administrator
  • Windows : Make sure Lanemu.exe is always run as administrator
    • Navigate to Lanemu -> build folder
    • Right click Lanemu.exe
    • Click Properties
    • Select Compatibility tab
    • Check Run this program as an administrator
    • Click Apply and OK
  • Launch Lanemu
    • Windows
      • Open Lanemu.exe
    • Linux
      • Open the Terminal in Lanemu -> build folder
        • sudo ./jdk/bin/java -jar Lanemu.jar
  • Do you want to join 'Default network'?
    • Click No
  • Click the Options icon and select Global tab
    • Specify Your Name
    • Specify any port in "Listen on Port" (e.g., 6666)
      • At least one user should enable UPnP or forward this port on the router
        • It is recommended to forward this port for both TCP and UDP
        • If you wish to only use TCP
          • Select Network tab and uncheck Use UDP for peer to peer traffic
      • If nobody can forward a port (stuck behind NAT)
        • All users can use hyper-nat (make sure everyone uses the same port)
        • If hyper-nat fails to connect, all users can route Tailscale or other similar VPN through Lanemu
          • Lanemu allows Layer 3 VPNs to work in games that require Broadcast / Multicast
          • Replace all instances of PublicIP:Port with Tailscale or other VPN IP (e.g., 100.111.88.108:6666)
        • Alternatively, one user (Host PC) can create a tunnel (e.g., playit.gg)
          • Lanemu supports TCP+UDP or TCP-only tunnels
          • Tunnel type requirements (TunnelIP:TunnelPort -> 127.0.0.1:LanemuPort)
            • TCP+UDP (e.g., tcp-udp-tunnel.gl.at.ply.gg:5359 -> 127.0.0.1:5359)
              • TunnelPort and LanemuPort must be identical
            • TCP-only (e.g., tcp-tunnel.gl.at.ply.gg:5359 -> 127.0.0.1:6666)
              • TunnelPort and LanemuPort can be the same or different
              • Host PC user must disable UDP option in Lanemu
                • Select Network tab and uncheck Use UDP for peer to peer traffic
    • Click OK
  • Steps for Host PC
    • If you are using hyper-nat
      • Modify hyper-nat options.json file
        {
            "schema": [
                {
                    "mode": "server",
                    "proto": "udp",
                    "port": "6666",
                    "host": "127.0.0.1",
                    "secret": "SomeUniqueTextThatIsTheSameForAllPorts"
                },
                {
                    "mode": "server",
                    "proto": "tcp",
                    "port": "6666",
                    "host": "127.0.0.1",
                    "secret": "SomeUniqueTextThatIsTheSameForAllPorts"
                }
            ]
        }
      • Launch hyper-nat
        • Windows
          • Open hyper-nat.exe
        • Linux
          • Open another Terminal in Lanemu -> build -> hyper-nat folder
            • npm install
            • npm run start
      • Windows : Allow hyper-nat through Windows Firewall
        • Check both Private and Public networks
        • Click Allow access
      • Copy your public key from the Console / Terminal
        • Windows
          • Highlight it and press CTRL + C
        • Linux
          • Highlight it and press CTRL + SHIFT + C
      • Send your public key to every Client
    • Create a network
      • Click the New Network icon
      • Select Simple tab
        • Specify Network Name
      • Select Advanced tab
        • If you are using UPnP / Port Forwarding or Tunneling Services
          • Specify your PublicIP:Port or TunnelIP:Port in Known Hosts
            • Example: 82.129.80.111:6666 or tcp-tunnel.gl.at.ply.gg:5359
        • If you are using hyper-nat
          • Specify these network settings
            • Known Hosts: 127.0.0.1:6666
            • BitTorrent Trackers: Empty
            • Enable DHT search for peers: No
      • Click OK
    • Windows : Allow OpenJDK through Windows Firewall
      • Check both Private and Public networks
      • Click Allow access
    • Create an invitation
      • Click the Invite Someone icon
      • Check Allow invitation of others
      • Click Generate Invitation
      • Click Save to a File
      • Click Close
    • Send the invitation file to every Client
  • Steps for Client PC
    • If you are using hyper-nat
      • Temporarily close Lanemu
        • Right click Lanemu tray icon and select Quit
      • Modify hyper-nat options.json file
        {
            "schema": [
                {
                    "mode": "client",
                    "proto": "udp",
                    "port": "6666",
                    "serverport": "6666",
                    "publicKey": "CopyPasteTheServerPublicKeyHere"
                },
                {
                    "mode": "client",
                    "proto": "tcp",
                    "port": "6666",
                    "serverport": "6666",
                    "publicKey": "CopyPasteTheServerPublicKeyHere"
                }
            ]
        }
      • Launch hyper-nat
        • Windows
          • Open hyper-nat.exe
        • Linux
          • Open another Terminal in Lanemu -> build -> hyper-nat folder
            • npm install
            • npm run start
      • Windows : Allow hyper-nat through Windows Firewall
        • Check both Private and Public networks
        • Click Allow access
      • Wait until hyper-nat establishes connection to the server
        • The window closes if connection fails, you might have to retry several times
      • Relaunch Lanemu
    • Join a network
      • Click the Accept Invitation icon
      • Click Load from File
      • Click OK
    • Windows : Allow OpenJDK through Windows Firewall
      • Check both Private and Public networks
      • Click Allow access
    • Wait for connection
      • If connection did not occur automatically
        • Option 1 : Click the Connect to Known IPs icon at the bottom
        • Option 2 : Click the Information icon at the bottom and select Connections tab
          • If you are using hyper-nat
            • Enter 127.0.0.1:Port (e.g., 127.0.0.1:6666) next to the Connect To button and click it
          • If you are using other connection method
            • Enter a peer PublicIP:Port or TunnelIP:Port next to the Connect To button and click it
  • Linux : Open another Terminal to add Broadcast and Multicast routes
    • sudo ip route append 255.255.255.255/32 via 0.0.0.0 metric 0 dev tap0
    • sudo ip route append 224.0.0.0/4 via 0.0.0.0 metric 0 dev tap0
@Darthagnon
Copy link

Darthagnon commented Jul 8, 2025

You may be interested in mDNS/Bonjour/Avahi (v2.0.2 standalone, v3.1.0.1 is included with iTunes and can be extracted from the installer) - this allows addressing LAN computers by computername.local rather than by constantly changing IP addresses.

@Darthagnon
Copy link

May I republish your instructions (crediting you, and linking back to here) on my blog?

@Nachlor
Copy link
Author

Nachlor commented Jul 8, 2025

May I republish your instructions (crediting you, and linking back to here) on my blog?

Sure, go ahead :)

@pftmclub
Copy link

I just don't get the hyper-nat part, how do you get the IP for the direct connect ?

@Nachlor
Copy link
Author

Nachlor commented Jul 25, 2025

I just don't get the hyper-nat part, how do you get the IP for the direct connect ?

To be honest, I haven't really tried to understand how hyper-nat (hyperswarm) works :D

Once a "swarm" is created, everyone connects to the same IP (127.0.0.1:LanemuPort).

After that, Lanemu assigns you its own IP which can be found in Options -> Network -> VPN IP. You can use Lanemu's IP in Direct IP games, though it's not even necessary in most cases because Lanemu supports auto-discovery via Broadcast / Multicast.

@pftmclub
Copy link

pftmclub commented Jul 26, 2025

I just don't get the hyper-nat part, how do you get the IP for the direct connect ?

To be honest, I haven't really tried to understand how hyper-nat (hyperswarm) works :D

Once a "swarm" is created, everyone connects to the same IP (127.0.0.1:LanemuPort).

After that, Lanemu assigns you its own IP which can

be found in Options -> Network -> VPN IP. You can use Lanemu's IP in Direct IP games, though it's not even necessary in most cases because Lanemu supports auto-discovery via Broadcast / Multicast.

There is one problem i don't understand, i run a lanemu network on my VPS, all of my friends can connect to my network and being able to ping my peer from my server, but those friend got indirect status via the V arrow icon and they can't
ping each other. If i host the hyper-nat at my server, will it solve the problem?

Edit: they are all behind NAT .
Screenshot_2025-07-26-11-05-31-012_com brave browser

@Nachlor
Copy link
Author

Nachlor commented Jul 26, 2025

There is one problem i don't understand, i run a lanemu network on my VPS, all of my friends can connect to my network and being able to ping my peer from my server, but those friend got indirect status via the V arrow icon and they can't ping each other.

Don't worry about the V arrow - it simply indicates that your friends can reach each other through the VPS peer.

If i host the hyper-nat at my server, will it solve the problem?

It's not really a "problem" in your case. All traffic is still routed through your own VPS instead of some slow relay server.

Edit: they are all behind NAT.

If some users weren't behind NAT, they could use UPnP / Port Forwarding for more direct connections. Running hyper-nat could achieve a similar effect via hole-punching. But then again, I don't think that's necessary for your situation. Your VPS should handle everything just fine :)

@Nachlor
Copy link
Author

Nachlor commented Jul 26, 2025

Screenshot_2025-07-26-11-05-31-012_com brave browser

By the way, this NAT type isn't bad. UPnP / Port Forwarding should be viable if no Symmetric NAT is involved.

@pftmclub
Copy link

pftmclub commented Aug 1, 2025

Screenshot_2025-07-26-11-05-31-012_com brave browser

By the way, this NAT type isn't bad. UPnP / Port Forwarding should be viable if no Symmetric NAT is involved.

Hello, both of my friend trying to play Gamecube games via dolphin netplay. They can't connect to each other even my peer at server can be direct connected by both of them. Is there any step i have to config for my VPS?

received_1128964942614599 received_686154134449869

@Nachlor
Copy link
Author

Nachlor commented Aug 1, 2025

Is there any step i have to config for my VPS?

Does your VPS expose a port for both UDP and TCP? TCP is definitely working because you can see users in Lanemu GUI. If you can't expose UDP, you need to disable UDP for the Administrator peer (uncheck "Use UDP for peer to peer traffic" in Lanemu -> Options -> Network).

@pftmclub
Copy link

pftmclub commented Aug 1, 2025

Is there any step i have to config for my VPS?

Does your VPS expose a port for both UDP and TCP? TCP is definitely working because you can see users in Lanemu GUI. If you can't expose UDP, you need to disable UDP for the Administrator peer (uncheck "Use UDP for peer to peer traffic" in Lanemu -> Options -> Network).

yes, my VPS support both UDP and TCP port forwarding !

@Nachlor
Copy link
Author

Nachlor commented Aug 1, 2025

yes, my VPS support both UDP and TCP port forwarding !

Make sure everyone has Dolphin allowed on Windows Firewall for both Private and Public networks.

If someone has any other VPNs installed (e.g., Radmin, Hamachi, ZeroTier, GameRanger), it would be better to disable their network adapters.

Not sure about Dolphin, but maybe it has a setting for choosing which network adapter to use?

@pftmclub
Copy link

pftmclub commented Aug 2, 2025

yes, my VPS support both UDP and TCP port forwarding !

Make sure everyone has Dolphin allowed on Windows Firewall for both Private and Public networks.

If someone has any other VPNs installed (e.g., Radmin, Hamachi, ZeroTier, GameRanger), it would be better to disable their network adapters.

Not sure about Dolphin, but maybe it has a setting for choosing which network adapter to use?

The problem is both of them can't ping each other with indirect status through command prompt

Just found new alternative to lanemu with NAT traversal and relay server support. Will you look at it and make a tutorial for it?

https://github.com/anywherelan/awl

@Nachlor
Copy link
Author

Nachlor commented Aug 2, 2025

The problem is both of them can't ping each other with indirect status through command prompt

I doubt that indirect connection is the issue here. Could you test any other PC game with LAN multiplayer?

Just found new alternative to lanemu with NAT traversal and relay server support. Will you look at it and make a tutorial for it?

https://github.com/anywherelan/awl

Not a fan of it because it's a Layer 3 VPN (incompatible with games like Blur that don't have a Direct IP option and rely on auto-discovery via Broadcast / Multicast).

@Nachlor
Copy link
Author

Nachlor commented Aug 2, 2025

Just found new alternative to lanemu with NAT traversal and relay server support.

Besides, you can use hyper-nat for NAT Traversal (hole-punching). You can recreate Lanemu network and specify two IPs in Known Hosts (PublicIP:6666;127.0.0.1:6666), so users can connect automatically with or without hyper-nat (clients should temporarily close Lanemu before connecting to your hyper-nat server). BitTorrent Tracker and DHT are not necessary because your VPS is hosted 24/7 and its PublicIP isn't likely to change.

@pftmclub
Copy link

pftmclub commented Aug 3, 2025

Just found new alternative to lanemu with NAT traversal and relay server support.

Besides, you can use hyper-nat for NAT Traversal (hole-punching). You can recreate Lanemu network and specify two IPs in Known Hosts (PublicIP:6666;127.0.0.1:6666), so users can connect automatically with or without hyper-nat (clients should temporarily close Lanemu before connecting to your hyper-nat server). BitTorrent Tracker and DHT are not necessary because your VPS is hosted 24/7 and its PublicIP isn't likely to change.

May i ask why is the "host" section have to be 127.0.0.1 ? What's happend if i set it to PublicIP ? Can the two computer connect to my VPS Public IP from Hyper-nat then ping each other with their Dynamic IP instead?

And latency from Lanemu Virtual IP are not stable sometimes, you can see the suddenly 85ms latency while the Pubic IP got stable ~25ms
image

@Nachlor
Copy link
Author

Nachlor commented Aug 3, 2025

May i ask why is the "host" section have to be 127.0.0.1 ? What's happend if i set it to PublicIP ? Can the two computer connect to my VPS Public IP from Hyper-nat then ping each other with their Dynamic IP instead?

Actually, I haven't tested a scenario where both port forwarding and hyper-nat are used. The 127.0.0.1:6666 would be required if you hosted a hyper-nat server without port forwarding (this IP connects a client to itself, which in turn connects to your hyper-nat server).

What happens if you use hyper-nat and don't specify 127.0.0.1:6666 in Known Hosts? Try it with 3 or more users and check if everyone gets a direct connection.

And latency from Lanemu Virtual IP are not stable sometimes, you can see the suddenly 85ms latency while the Pubic IP got stable ~25ms

Spikes can happen from time to time. Does it always repeat when you ping the VPN IP?

@pftmclub
Copy link

pftmclub commented Aug 3, 2025

May i ask why is the "host" section have to be 127.0.0.1 ? What's happend if i set it to PublicIP ? Can the two computer connect to my VPS Public IP from Hyper-nat then ping each other with their Dynamic IP instead?

Actually, I haven't tested a scenario where both port forwarding and hyper-nat are used. The 127.0.0.1:6666 would be required if you hosted a hyper-nat server without port forwarding (this IP connects a client to itself, which in turn connects to your hyper-nat server).

Then i just have to use the VPS Public IP if i hosted a hyper-nat server on VPS , right ?

What happens if you use hyper-nat and don't specify 127.0.0.1:6666 in Known Hosts? Try it with 3 or more users and check if everyone gets a direct connection.

What's i truly mean is that can both client connected to each other using hyper-nat but without VPN if i specify VPS public IP on hyper-nat server?

And latency from Lanemu Virtual IP are not stable sometimes, you can see the suddenly 85ms latency while the Pubic IP got stable ~25ms

Spikes can happen from time to time. Does it always repeat when you ping the VPN IP?

Yes, it's always repeat when i open Lanemu then ping the VPN IP after few second . There is no spikes when i ping the public IP itself

@Nachlor
Copy link
Author

Nachlor commented Aug 3, 2025

Then i just have to use the VPS Public IP if i hosted a hyper-nat server on VPS , right ?

What's i truly mean is that can both client connected to each other using hyper-nat but without VPN if i specify VPS public IP on hyper-nat server?

Keep it simple and host both Lanemu and hyper-nat on the same VPS:

Lanemu

  • I'd recommend adding both IPs to Known Hosts (VPS_PublicIP:6666;127.0.0.1:6666). If your VPS ever shuts down, some other user can copy your hyper-nat options.json file and act as a server :)

hyper-nat

  • Don't change the "host" section from options.json file, just leave it at "127.0.0.1".

Yes, it's always repeat when i open Lanemu then ping the VPN IP after few second . There is no spikes when i ping the public IP itself

Perhaps it's not noticeable during gameplay? If everything feels smooth, I wouldn't worry about it.

@Monsterovich
Copy link

Monsterovich commented Aug 8, 2025

And latency from Lanemu Virtual IP are not stable sometimes, you can see the suddenly 85ms latency while the Pubic IP got stable ~25ms

This is unlikely to be related to Lanemu. Packets are being lost. I can reproduce this randomly on any public IP address. Just make sure you have UDP mode enabled. I would avoid TCP/UDP in TCP when possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment