TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

NAT-to-NAT direct connections with no proxy/STUN needed

162 pointsby metabrewabout 15 years ago

13 comments

tptacekabout 15 years ago
Cheat sheet version: one side sends packets to a bogus IP, the other side sends ICMP TTL Exceeded packets back. Some NATs will pass the TTL Exceeded packets because that's how traceroute works; the ICMP packets are indistinguishable from "real" traceroute responses. Once both sides know each other's IP addresses, they open a tunnel by simultaneously talking outbound UDP to each other.<p>This is a clever trick for home NATs, but most corporate networks are doing more than NAT'ing; they're dropping everything but DNS and HTTP from a proxy.
评论 #1225144 未加载
评论 #1225388 未加载
评论 #1225217 未加载
tophercyllabout 15 years ago
We're experimenting with this technique in our peer-to-peer software. Unfortunately we probably won't have data on what percentage of the time it works for a few weeks.<p>Provided everything goes okay, I'll try to post our data as a follow up.
评论 #1225265 未加载
评论 #1225816 未加载
评论 #1225255 未加载
latitudeabout 15 years ago
The trick with priming NAT for receiving bogus inbound TTL-Exceeded ICMP packets is really clever. However keep in mind that this method assumes that:<p>(a) the client knows server's external ("Internet") IP<p>(b) there is exactly one server behind the NAT device<p>Latter is obviously quite limiting unless the "3.3.3.3" changes for every server and the client learns it together with server's external IP. This in turn means that the client still needs to communicate with some 3rd party, so this method only partly alleviates the need for the 3rd party during the tunnel setup process, but it does not completely eliminate it.
billpgabout 15 years ago
Isn't 3.3.3.3 an IP inside the General Electric Company? What happens if they ever decide to use it?
00joeabout 15 years ago
Ok, so ICMP is easy to turn off. But why couldn't this technique be done over UDP or TCP? The server could send a UDP packet to a known "fake" address and the client could spoof its source address to penetrate the nat.
评论 #1225158 未加载
评论 #1225157 未加载
daviduabout 15 years ago
I know Samy well. Probably more than 10 years.<p>He's one of the best of the best. I'd hire him in a second if he'd let me.
jbedaabout 15 years ago
This looks to be two things: a way of discovering ips and communicating them without STUN and a simple nat traversal using UDP. Th first is a little clever but not super interesting as signalling channels are a dime a dozen. The second is essentially a small subset of ICE and will fail if anyone remaps ports.
评论 #1225119 未加载
aleccoabout 15 years ago
This was dead-ed to allow this re-submission (thanks metabrew).<p>There is a great discussion @reddit <a href="http://www.reddit.com/r/programming/comments/bjc0g/pwnat_serverless_nat_to_nat_udp_hole_punching_for/" rel="nofollow">http://www.reddit.com/r/programming/comments/bjc0g/pwnat_ser...</a>
malbsabout 15 years ago
I might be showing my ignorance here, I'm not a network guy, but a vast majority of internal networks use 192.168.1.0/24 192.168.1.1/24 and so on. What happens when the source and destination networks both use the same class C addresses?
评论 #1225461 未加载
rubyrescueabout 15 years ago
very clever. how hard is it for the paranoid IT guy to block ICMP time exceeded packets inbound for 3.3.3.3 but not for other hosts, to stop servers from discovering clients?
评论 #1225046 未加载
评论 #1225064 未加载
评论 #1225079 未加载
评论 #1225063 未加载
deutroniumabout 15 years ago
Anyone mind posting the arguments for the server and client you're using. The server side segfaults for me.<p>Mine are:<p>Server: ./pwnat -s 2221<p>Client: ./pwnat -c ClientIP 3333 RemoteIP 2221
vijayshankarabout 15 years ago
Is there a possible segfault at line 108 in udpclient.c? pport is a junk pointer at this line: sprintf(pport, "2222");
评论 #1226259 未加载
defenestratorabout 15 years ago
how exactly is this different than netcat -u ?