You are not logged in.

#1 2018-11-17 15:34:53

Moosey_Linux
Member
From: Malmö Sweden
Registered: 2012-07-01
Posts: 44

Arch web server without a public IP

Hi guys i´m setting up a web server on one of my Arch Linux machines but my ISP is not providing me whit a public IP. When I look at whatsmyip.org it says my IP is 82.209.145.109 that belongs to some HQ of my ISP.
My router gives me this information

IP Address: 100.78.235.204
Subnet Mask: 255.255.128.0
Default Gateway: 100.78.128.1
DNS Server: 83.233.79.36 , 83.233.79.37

And trace route

HOP RTT      ADDRESS
1   0.53 ms  192.168.0.1
2   8.13 ms  applepaj.cust.se.dataphone.net (212.37.8.22)
3   9.60 ms  pos4-0.se-gbg-backadalen-c2.dataphone.net (212.37.8.17)
4   10.00 ms hu0703-sto-esb11-cr1.se.bredband2.net (82.209.181.102)
5   10.01 ms 100.64.3.153
6   11.94 ms 100.64.0.2
7   ... 8
9   21.85 ms 82-209-145-109.cust.bredband2.com (82.209.145.109)

My question is what would be the best way to tunnel out and in to the internet, should I use SSH or is there any other better way?

Offline

#2 2018-11-17 15:44:18

headkase
Member
Registered: 2011-12-06
Posts: 1,975

Re: Arch web server without a public IP

In your router set up a DHCP reservation for your server so it always gets the same IP within your local network.  Then in the router forward the necessary ports to that reservation.  Then you can use a dynamic DNS service to hold your IP, like DynDNS.  That will provide an internet name that resolves to your router's IP which forwards the port to your DHCP reservation.  Your router might also contain functionality in its firmware to automatically update the internet-facing IP for your dynamic DNS name service when your router gets a new address.  If not then you can update your internet-facing IP on DynDNS or similar yourself or install software on a machine within your local network which does the same.

Edit: Sorry, I misunderstood your IP limits.  I'll leave my post though as it is what you do when you do have a stable internet-facing IP.

Last edited by headkase (2018-11-17 15:50:24)

Offline

#3 2018-11-17 18:45:11

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Arch web server without a public IP

SSH port-forwarding can be used, but you'd still need a machine (maybe a VPS) with a public internet facing IP. Have you considered asking your ISP whether they provide public IPs? One of the telcos in my area doesn't give those by default but will assign one (dynamic, not static) if requested for no additional charge. I think most will add on a regularly billed charge for it though.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2018-11-17 21:09:28

Moosey_Linux
Member
From: Malmö Sweden
Registered: 2012-07-01
Posts: 44

Re: Arch web server without a public IP

Wow is it really that hard! My parents ISP is providing them whit a public IP so that could be one way to do it. My think was that in a world where we are running out of IPv4 addresses this problem will only grow. So then it is best to learn how to do it the hard way. And if I can have a DDNS service for free from no-ip then I could tunnel to somewhere for free and tunnel backswords to my webpage. Or I was hoping it would work like that...

Offline

#5 2018-11-17 21:18:49

loqs
Member
Registered: 2014-03-06
Posts: 17,192

Re: Arch web server without a public IP

The long term solution was supposed to be IPV6 with no NAT rather than ISP level NAT on top of NAT at your local router.

Offline

#6 2018-11-17 21:28:19

Moosey_Linux
Member
From: Malmö Sweden
Registered: 2012-07-01
Posts: 44

Re: Arch web server without a public IP

Yes I don't know why the whole world cant change to IPv6!

Offline

#7 2018-11-17 23:47:17

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Arch web server without a public IP

Moosey_Linux wrote:

Wow is it really that hard! My parents ISP is providing them whit a public IP so that could be one way to do it. My think was that in a world where we are running out of IPv4 addresses this problem will only grow. So then it is best to learn how to do it the hard way. And if I can have a DDNS service for free from no-ip then I could tunnel to somewhere for free and tunnel backswords to my webpage. Or I was hoping it would work like that...

'tunnel somewhere for free'.... how much have you actually researched this? SSH port forwarding isn't really hard, but you do need access to the router at least, and likely a machine behind the router. You can even use your parents router for that....


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#8 2018-11-18 21:01:14

Moosey_Linux
Member
From: Malmö Sweden
Registered: 2012-07-01
Posts: 44

Re: Arch web server without a public IP

Sorry ngoonee if I got it wrong, but yesterday when I was trying to research this I got the impression that the one who wants to visiting the page hade to configure their web browser to use SOCKS proxy. If that would be the case it defeats the purpose of making a home page as it will get zero visitors.

So if i got it right this time, the simple thing of it all is that it takes one command to get the tunnel up.

ssh -R 80:localhost:80 user@myparentsIP

Then if a have added GatewayPorts yes to my sshd_config and if my parents router accepts ssh connections any one typing "myparentsIP" to their web browser will come to my web page?

Sorry again ngoonee the ssh tip was great not only for this but for a lot of other things to thanks a lot.

Offline

#9 2018-11-21 11:07:56

sincomil
Member
Registered: 2018-02-13
Posts: 106

Re: Arch web server without a public IP

Moosey_Linux, if you want to get your web-server accessed FROM the whole world then you have to get PUBLIC IP-address, or you need to ask you ISP to make DNAT to you web-server listening port, and I'm sure you will get negative answer from ISP, so correct solution is buy/lease 1 PUBLIC IP from ISP and be happy.
Or just rent a VPS from one of the cheapest cloud providers (ex, hetzner.de) and place you server there - this way that I  were prefer if I was you

Last edited by sincomil (2018-11-21 11:14:00)

Offline

#10 2018-11-21 21:51:20

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 649

Re: Arch web server without a public IP

sincomil wrote:

Moosey_Linux, if you want to get your web-server accessed FROM the whole world then you have to get PUBLIC IP-address ..

No you don't, just use a dynamic DNS service. There are a few good free ones. IMHO, the best free service is DuckDNS.

Offline

#11 2018-11-21 22:59:42

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Arch web server without a public IP

No, they need a public IP address.  They also need a way for people to find it; that is where a service such as DDNS comes into play.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#12 2018-11-22 07:46:42

sincomil
Member
Registered: 2018-02-13
Posts: 106

Re: Arch web server without a public IP

bulletmark wrote:
sincomil wrote:

Moosey_Linux, if you want to get your web-server accessed FROM the whole world then you have to get PUBLIC IP-address ..

No you don't, just use a dynamic DNS service. There are a few good free ones. IMHO, the best free service is DuckDNS.

You should understand difference between  Public and Private IP addresses and why its called that way. Public address is publicly accessible opposite to Private that is NOT accesssible by anyone but only they who share that "privacy" (at home/office/corporation)

Last edited by sincomil (2018-11-22 07:47:38)

Offline

#13 2018-11-26 07:26:27

tracernz
Member
Registered: 2018-03-03
Posts: 1

Re: Arch web server without a public IP

What your ISP is doing is called carrier grade NAT (CGNAT). It's a cheap way to continue using IPv4 without purchasing more (expensive) IPv4 address space, by sharing one IP amongst a large group of customers. I second the suggestion to rent a cheap VPS. If you prefer to host the server at your home, setup a VPN tunnel between your VPS and your home server (WireGuard or tinc would be my suggestion), install haproxy/nginx/?? on the VPS and reverse proxy to your home server.

Last edited by tracernz (2018-11-26 07:27:21)

Offline

Board footer

Powered by FluxBB