Local ip share when share links with external customer

hi

when i copy share links of files i have local ip in address, but i want to send shares to external users. If they use that link the get my local ip, not internet -facing external ip.
How can i change share links to have external ip instead of internal ip?

Hi @sandy

By logging into Nextcloud with an “external” URL / domain name. Otherwise, your only option is to manually adjust the links before you send them, which is of course not really practical.

Keywords you could use in the forum search or in the internet search engine of your choice are:

  • NAT Loopback, Hairpin NAT
  • Split brain DNS resp. local DNS overrides (preferred variant)

If you get stuck, we are happy to help. But we would need some more information about your infrastructure.

  • Do you already have a domain name to access the Nextcloud from outside your network?
  • How does your network infrastructure look like? Router, firewall, DNS etc…?
1 Like

In such cases in can help to send the config file. there are options to change that:

These to set to your external ip. For SSL certificates, it’s better to use hostnames, then you can publicly resolve the hostname to your public ip and internally, you can use your own dns resolver that resolves to your private ip (sometimes the official one works as well but that depends on your router). That’s a bit what bb7 told you already.

And if you have ipv6, it should work from local and remote since there is not NAT and stuff like that

1 Like

This!

@sandy
I would highly recommend to go this route. Working with IP addresses is not good practice, when your Nextcloud server is publicly accesable. And if you want to use “real”, i.e. signed SSL certificates from e.g. Let’s Encrypt, so that the people you share the files with, don’t get warnings in their browsers, you need a publicly resolvable FQDN (fully qualified domain name) anyway.

Thanks for help. you want some information about my infrastructure.

    • Do you already have a domain name to access the Nextcloud from outside your network?
      I have not any domain name. I have only static IP which provided by my ISP. but i can access the our nextcloud server from out side using only use static IP ( Public ( IP)…like 89.166.152.63:8282.
  • How does your network infrastructure look like? Router, firewall, DNS etc…?
    I have a router which provided by ISP .At ISP router configure a DMZ zone . After that I have a firewall .at this firewall port has been forwarded.

for example i have create a sharelink which showing the address is http://192.168.0.7:8282/s/bHNFr5GQ46MPSqs
but i want change the this ip 192.168.0.7 to our static ip 89.166.152.63
how can be do that ?

.

Thanks for your reply. But I don’t have any domain name. Only I have static IP address . How to be every time I have change local ip to external IP

…then you should probably buy one, if you want to share links with people outside of your local network.

AFAIK you cannot. The links in Nextcloud are generated with the IP address or domain name you are connected / logged in at the moment you generate them. You could try to always login with the external IP, if your router supports NAT reflection / NAT loopback.

But this aside… For other, more important reasons, you should buy a domain name and install proper SSL certificates. It is not advisable and considered bad practice to use IP-addresses for publicly hosted services. I hope you use at least self-signed certificates. Unencrypted connections are an absolute “no go” if the service is accessible from the Internet.