Score:0

Accessing the server using the router's IP works inside the network, but not outside

in flag

So I have a domain (nextcloud.selfhosted.tamashalasi.com) which points to 91.101.56.134: A Record which connects the domain to the IP

The public IP of my router is the mentioned IP, this screenshot is from https://whatismyipaddress.com/ My IP address

...and this is from the router's page (note that although it is a dynamic IP address, the IP address only changes if the MAC address of the router changes): enter image description here

I have a server on the network which has the name "debian". It has a permanent IP address of 192.168.0.101; the ports 80 and 443 get forwarded to this IP. enter image description here enter image description here

The server runs on a barebones debian 5.10.0, with nginx installed, running the default config with server_name nextcloud.selfhosted.tamashalasi.com added to it. I also added an extra rule to iptables, which I added to enable accessing port 80. This is the output of iptables -L (docker is also installed, but that shouldn't be a problem I suppose):

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http

Chain FORWARD (policy DROP)
target     prot opt source               destination
DOCKER-USER  all  --  anywhere             anywhere
DOCKER-ISOLATION-STAGE-1  all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain DOCKER (3 references)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             172.20.0.2           tcp dpt:http

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target     prot opt source               destination
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere

Chain DOCKER-ISOLATION-STAGE-2 (3 references)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere

Chain DOCKER-USER (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

With this config, I can access http://nextcloud.selfhosted.tamashalasi.com/ inside my local network, but can't outside it. Accessing the IP directly yields the same results.

I would like to make the IP accessible outside my local network; do you know what might have gone wrong?

Note that I am a total server setup noob. If this post doesn't belong here, I would love if you could point me somewhere where the post does belong so that this issue can be solved. Thank you ❤️

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.