problem with LAN connection enet udp

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: problem with LAN connection enet udp

Post by grump »

Connecting from one machine on the LAN to another machine on the same LAN through the router's public IP address using static NAT/"port forwarding" requires explicit support from the router. Not every device can do it.

It's called hairpinning.
User avatar
pgimeno
Party member
Posts: 3655
Joined: Sun Oct 18, 2015 2:58 pm

Re: problem with LAN connection enet udp

Post by pgimeno »

@togFox can you show a snapshot of your router configuration?
User avatar
togFox
Party member
Posts: 828
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: problem with LAN connection enet udp

Post by togFox »

I'll do that in a few days - after vacation. Thanks!
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
User avatar
togFox
Party member
Posts: 828
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: problem with LAN connection enet udp

Post by togFox »

pgimeno wrote: Wed Dec 15, 2021 2:59 pm @togFox can you show a snapshot of your router configuration?
Establishing a server with sock.lua

Code: Select all

server = Sock.newServer("*", 22122)
Establishing a client:

Code: Select all

client = Sock.newClient(GAME_SETTINGS.hostIP, tonumber(GAME_SETTINGS.hostPort))
if on same computer or on lan then GAME_SETTINGS.hostIP = 192.168.20.4

if on internet/WAN then GAME_SETTINGS.hostIP = whatever 'whatsmyip' says.

GAME_SETTINGS.hostPort = 22122

Edit: to reiterate, sock on same machine and LAN works. Internet does not work. Sock doesn't throw an error so idk. It looks like the client searches and times out.

Let me know if this is not the right screen.


Thanks.



Image
Last edited by togFox on Mon Dec 20, 2021 10:05 pm, edited 1 time in total.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
User avatar
EngineerSmith
Prole
Posts: 38
Joined: Thu Dec 02, 2021 11:38 am
Contact:

Re: problem with LAN connection enet udp

Post by EngineerSmith »

Looking at it your NAT looks fine as it should accept 22122 and then redirect to 192.168.20.4:22122 (Make sure that is your server's private ip; as some routers usually refresh/cycle ip addresses every 24 hours or so unless you've assigned it to it's mac address)

If firewall allows LAN within the private network then, it should allow WAN - so it wouldn't be an issue there. So just double check your server's private ip for the NAT. It's the only thing I can think of looking at it
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest