i’m running nextcloud 18.04
i don’t see a way of changing the vm’s wan ip address.
its currently set to using our company’s main ip address (which is what our mail server uses) & i would like to change it an external ip that i’ve already reserved for the cloud vm. i’ve also already forwarded those ports to this vm in our firewall.
/etc/network/interfaces does not contain network settings. i was able to discover that ipv4 settings are at /etc/netplan/01-netcfg.yaml. maybe there is a setting that belongs there that i am not familiar with.
WAN IPs are not normally set on the server itself. This will be in your firewall.
my firewall is already configured for multiple ip’s & where those ports are forwarded.
i think nextcloud is using dig (or another tool) to automatically figure out a person’s wan ip address. this works for individuals but, i think, most companies have multiple ip addresses & the primary wan ip may already be assigned.
from the feedback i’m getting (& my lack of search results in finding a solution), i’m presuming nextcloud is presuming the wan ip address it is pulling is what it can use. & maybe there is no way to tell nextcloud to “listen” at a different wan ip. & since its behind a firewall, anyway, maybe that doesn’t matter.
i may be getting ahead of myself. (i’m still working on configuring other parts of my nextcloud vm. i haven’t started testing it from external to my company)
externally, the ip i plan to use may be fine for nextcloud (& that ip & ports are already configured in my firewall for forwarding to the vm’s ip). as long as nextcloud is listening at those ports (& not a specific ip’s ports).
just thought i would check into this & see what others have done.
As you already figured out you set the IP address in Netplan.
If you want to change the WAN IP (e.g use it instead of LAN) just set the address on the NIC that WAN comes in on, e.g. eth0.
Save your changes with: sudo netplan apply
You can also use the built in static ip script by running: sudo bash /var/scripts/menu.sh
The informative text after login may be inaccurate, but has no effect on the actual settings. It just displays what it thinks are the correct values based on dig.
Hope it helps!