Skip to content

chore(hole-punch): deterministic interface mapping#858

Open
gmelodie wants to merge 1 commit into
libp2p:masterfrom
gmelodie:master
Open

chore(hole-punch): deterministic interface mapping#858
gmelodie wants to merge 1 commit into
libp2p:masterfrom
gmelodie:master

Conversation

@gmelodie

@gmelodie gmelodie commented Jun 12, 2026

Copy link
Copy Markdown

Summary

The router SNATs LAN traffic out to the internet, but router/run.sh assumed a fixed
interface mapping (eth0 = internet, eth1 = lan). Docker doesn't guarantee that order,
so when it comes up reversed the SNAT rule is built backwards and the hole-punch test
fails nondeterministically.

This PR makes the router detect its external interface instead: it's the one that routes
toward the relay (which lives on the internet network), via ip route get <relay_ip>.
A short retry loop covers relay DNS not resolving yet at startup. No generator.ts change.

@gmelodie gmelodie marked this pull request as ready for review June 12, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant