Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Connecting from an internal and external network #47

Open
Kienguy opened this issue Apr 12, 2021 · 11 comments
Open

[Feature Request] Connecting from an internal and external network #47

Kienguy opened this issue Apr 12, 2021 · 11 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Kienguy
Copy link

Kienguy commented Apr 12, 2021

I'd like to access the neko instance on my local computer while also having my friend access it over the internet. From what I can tell, the NEKO_NAT1TO1 variable only can accept one ip address at a time. Is there a solution to this I'm missing?

@m1k1o
Copy link
Owner

m1k1o commented Apr 12, 2021

It can accept multiple addresses, separated by space.

@Kienguy
Copy link
Author

Kienguy commented Apr 12, 2021

I see. Thank you

@Kienguy Kienguy closed this as completed Apr 12, 2021
@Kienguy
Copy link
Author

Kienguy commented Apr 12, 2021

My apologies for reopening this, but I'm now getting an error for "invalid 1:1 NAT IP mapping"

@Kienguy Kienguy reopened this Apr 12, 2021
@m1k1o
Copy link
Owner

m1k1o commented Apr 13, 2021

I am not sure how that works in pion. We are only pasing this variable down to pion.

@m1k1o m1k1o added the help wanted Extra attention is needed label Apr 15, 2021
@kokomo123
Copy link

kokomo123 commented May 16, 2021

I have this same issue as well, whenever i space two ip addresses out i'm unable to use both of them. It's either using the public ip address, using another ip address, or something when i input the env. so it's likely pion's fault on this one, maybe?
edit: i also get disconnects when im using my public ip address, though i've tested via my phone and it works fine there, just don't know how to configure it so i can be on my local lan and be able to watch..

@mbattista
Copy link
Contributor

How do you separate the two IPs?
As said before neko expects a whitespace between the IPs, no comma or slash. E.g. 192.168.2.1 192.168.2.5

Further NAT1T is an optional field. Perhaps omitting it work in your case (explanation below)? Have you tried writing the internal IP first?

At last I think the main problem is your router. It does bot support hairpinning [link].

If you enable NAT1to1 neko reponse with the IPs given. The external IP is reachable and known for your local lan, so it tries to connect over it. The traffic stops at your router which without hairpinning does not know what to do and drops the traffic.

@m1k1o
Copy link
Owner

m1k1o commented May 16, 2021

I've been following original issue, that is introducing this functionality here. It looks like, also name says it, it is only NAT 1:1. Multiple addresses were meant for IPv4 and IPv6, that's why it with different addresses don't work. Although, there is option to add new addres to existing (private) but since we are in Docker, even that private would not work.

Perhaps one solution could be running this with --net=host and calling SetNAT1To1IPs with ICECandidateTypeSrflx option. I didn't try that yet, so that would be only theoretical solution.

@kokomo123
Copy link

kokomo123 commented May 16, 2021

How do you separate the two IPs?
As said before neko expects a whitespace between the IPs, no comma or slash. E.g. 192.168.2.1 192.168.2.5

Further NAT1T is an optional field. Perhaps omitting it work in your case (explanation below)? Have you tried writing the internal IP first?

At last I think the main problem is your router. It does bot support hairpinning [link].

If you enable NAT1to1 neko reponse with the IPs given. The external IP is reachable and known for your local lan, so it tries to connect over it. The traffic stops at your router which without hairpinning does not know what to do and drops the traffic.

Ah, it may be hairpinning at my virtual router. so, it might be a firewall rule i could make somehow. Thanks... it's probably not NAT1TO1's fault at all and can be my own. Nevermind then, 👍🏻

@mbattista
Copy link
Contributor

mbattista commented May 17, 2021

Have you tried what happens if you omit the value?

I run neko behind two routers in a docker and I can connect to it with internal and external IP without having to specify NAT1to1.

@kokomo123
Copy link

I'll try omitting that and try running it with reverse proxy, if that doesn't work i might have to change the network connection for the machine i guess to my actual LAN instead of the virtual router's LAN.

@m1k1o m1k1o changed the title Connecting from an internal and external network [Feature Request] Connecting from an internal and external network Jul 23, 2021
@m1k1o m1k1o added the enhancement New feature or request label Jul 23, 2021
@m1k1o m1k1o mentioned this issue Oct 16, 2021
27 tasks
@m1k1o
Copy link
Owner

m1k1o commented Jun 17, 2022

There might be posibility to acheive this using a hack. Rewriting IP on client in SDP messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants