Host server at home behind ISP NAT using STUN
Solution 1
I doubt STUN will help you, as it is used to work out a public IP address from a natted address (https://en.wikipedia.org/wiki/STUN) The correct solution is "If your ISP is not providing you with ISP services, move". [ Really, if they are not giving you a real world IP address to do with as you need, they are not acting as a proper ISP ]
Your options are probably quite limited - I would solve the problem by setting up a VPN from your box to another externally located server (and not use your home box as a VPN server, only client) to provide you with remote access into your box [ using the VPN service you are purchasing for VPN activities ].
Similarly, you could rig up a reverse connection (I have used SSH for this in the past), but you still need a reachable endpoint on the Internet.
Food For Thought - Depending on your ISP and requirements it probably won't work for you, but if you can use a tunnel broker (there are a few free ones - I use sixxs) from your [natted] box you can probably get yourself a legitimate IPV6 address to use from wherever. The downside is wherever you want to use the service from needs to support IPV6 !!!
Solution 2
The solution is PWNAT.
I tested and it works flawlessly.
Related videos on Youtube
Casper
Updated on September 18, 2022Comments
-
Casper over 1 year
I'm hosting my own Linux server at home, which I will be using as a VPN server and web hosting if possible, problem is that I'm behind my ISP's NAT which means that I'm unable to connect to my server from the outside.
I have contacted my ISP, but they won't open a port or enable port forwarding for me :(
I've read that its possible to use UPN/TCP hole punch using a 3rd server. I've researched and found multiple free STUN servers which i believe should be able to do the job?Now here's the question: Is this possible, and if; Could you please point me in the direction of how it's done? Maybe there's an alternate solution to my problem?
Any help is appreciated! Thanks for reading my question.
Casper
-
Ron Maupin over 7 yearsAlmost all residential ISPs have a clause in their agreements that forbids running servers from your home to the Internet, so they don't really care that this does not work. As the available IPv4 addresses run out, the ISPs need to save them for businesses willing to pay for the privilege of getting a public address.
-
BBK over 5 yearsI have posted my question, similar to yours, but not precisly the same stackoverflow.com/questions/54118006/vpn-with-webrtc-stun-ice
-
-
Casper about 11 yearsThank you very much for your answer! You're probably right about moving, it seems a bit 1990-ish that you can't get a proper IP-address to get the most out of your internet connection.. I've considered a VPN or reverse SSH tunnel as you mention, but the problem is that it would limit my bandwidth alot, since it had to be routed through a 3rd server.. EDIT: Sorry i havn't got enough reputation to upvote your answer yet ;/
-
davidgo about 11 yearsRe:VPN - If you set it up with compression a VPN will probably give you MORE bandwidth (especially if you are doing a remote desktop application). It will increase your latency though, so if that is a concern you would want to find a provider close to you. (As far as upvoting goes, I think you can just click an arrow which appears under the number of votes to accept the answer as the official one !)
-
Casper about 11 yearsI didn't mean bandwidth in like a monthly cap, but more like in speed. If i have to route my connection through a 3rd server it will really slow things down.. Thanks for the follow up, here take my vote!
-
Omid N over 3 years@Casper up-voted your question to gain the reputation you want.