Change WAN IPv4 & Mailserver problem


I’m running a Nextcloud VM (27.1.8) on Hyper-V on a Windows Server 2019 (dedicated Strato Server). I set up a NAT switch with a NATnetwork and also configured port forwarding. Most things a running fine, beside two points.

  1. My server got two external IPv4 adresses XXX.YYY.ZZZ.AAA & XXX.YYY.ZZZ.BBB. Both adresses are set on the same network adapter AAA is the fist and BBB is the second. AAA is set for the running mail server and BBB acts for all other things, like webserver and so on. But sadly Nextcloud automatically snaps AAA as WAN IPv4, but it must be BBB. The subdomain for Nextcloud also points to BBB and that works. How can I change the WAN IPv4 in Nextcloud?

  2. I can’t set up mail in Nextcloud with my own mailserver. It always fails. Using works without problems. Maybe, it has to do with the WAN IPv4 problem? Possibly it’s a conflict, while the mailserver runs on the IP, Nextcloud uses as his WAN IPv4?

Thanks for help and ideas! :blush:


If you use port forwarding and NAT, your Nextcloud just has a local ipv4 and you forward it to it: E.g. XXX.YYY.ZZZ.BBB:443 ↔ 192.168.x.y:443 (the ports might differ)?
What snaps on the AAA ip of Nextcloud, the virtual machine, the Nextcloud config?

For the mailserver, I’m not sure if via ipv4 it is routed correctly, if the VM already thinks it has the same ip as the mailhost. And if you ping the mailserver from your virtual machine?
In this case, ipv6 could be easier to at least solve the mailserver issue. All your hosts could have a ipv6 address and then connect to each other more easily (without NATing and setting up port forwarding). If you send out all the Nextcloud mails via your mailserver, it does not matter, if you have to use ipv6.

Sorry it took me so long to reply, but some other priorities are currently keeping me from my Nextcloud project. But as soon as I can, I’ll check your hints and give you feedback.