External IP address issue

**Operating system** - Ubuntu Linux 22.04.3
**Webmin version** - 2.105
**Usermin version** - 2.005
**Virtualmin version** - 7.9.0
**Authentic theme version** - 21.09.5
Perl version - 5.034000
Path to Perl - /usr/bin/perl
Python version - 3.10.12
Path to Python - /bin/python3
BIND version - 9.18
Postfix version - 3.6.4
Mail injection command - /usr/lib/sendmail -t
Apache version - 2.4.52
PHP versions - 7.4.33, 8.0.30, 8.1.26, 8.2.13, 8.3.0
Webalizer version - 2.23-08
Logrotate version - 3.19.0
MariaDB version - 10.6.12
ProFTPD version - 1.37
SpamAssassin version - 3.4.6
ClamAV version - 0.103.9

Hello, the above is a clean fresh install of Ubuntu 22.04 with all it’s updates. (specifically 20.04 upgraded and dist-upgraded to 22.04 latest, I do not like the live installer, I get the system fully up to date with the only extra packages installed are ssh and openssh-server before executing sh virtualmin-install.sh as root

I did a lot of research on this before making this thread and I will put as much information as I can here.

On my first domain creation for management of the server, I did not notice any issues. The issues seem to have come from the restore from a Virtualmin 6.12 server backup (it was not a complete backup, only all servers and sub servers under 1 user). I am doing this migration since ever time I upgrade, I end up having to roll back because everything becomes un-responsive. The OS of the server being migrated is Ubuntu 18.04.5

Upon restoration, I did use the Addresses and Networking > Change IP Address > Address type to change > External address used in DNS records

that fixed the existing records, but since the server does not appear to be listening to the settings (this is actually a mixed bag in Virtualmin Configuration, it has been a little of a headache. Also to note, I setup everything in Virtualmin Configuration, Server Templates and Account Plan myself before performing a restoration.

I did NOT restore any:

Virtualmin configuration
Server templates and plans
New user email messages
Custom fields, links and shells
Third-party script installers
Scheduled Virtualmin backups
FTP directory restrictions
Mail server settings

I figured there might be too much of a gap between the versions to do that

My issue. The new server is seeing everything as the wrong external IP address. I have to manually choose an other address when creating servers even with

Virtualmin Configuration > Networking Settings > Default IP address for DNS records - I have this set to Other address and the correct address entered.

at first I turned my attention to the firewall thinking one of my NAT settings was incorrect, since the address that is being “detected” is the primary on the firewall. This was not used as an address on the server being restored from either.

After going in circles for a little bit on the firewall, I logged in via ssh console to the server and ran:

  1. curl ifconfig.me
  2. curl -4 icanhazip.com
  3. curl ipinfo.io/ip
  4. curl api.ipify.org
  5. curl checkip.dyndns.org

All of these return the correct IP address I am using in my port forwarding and my NAT setup.

I have tried all the other options under
Virtualmin Configuration > Networking Settings > Default IP address for DNS records, saved the settings and re-ran the configuration check and it still shows as the wrong IP address.

This is strange since I have another server that I setup about 2 months prior to this one, restoring different sites from it and did not run into this issue. (all of the same software was installed on that as this and is up to date currently as well)

I greatly appreciate any help anyone can provide on this issue,

Thank you,

Way too much info. :wink: Where did this ‘wrong address’ come from? Are you using a provider that uses private addresses internally by any chance?

My own physical server is behind a firewall, so private addresses and 1to1 nat via the firewall with port forwarding. My tests on the server show it to be set up and working correctly, but when I run the configuration check utility it shows

External IP address for DNS records is set to 2XX.1XX.12X.143, but the detected external address is actually 2XX.1XX.12x.132. This may cause DNS records for Virtualmin domains to point to the wrong system

both are valid public IP’s that I use, As I stated above, the .132 is the primary on the firewall but I set everything up with .143 and the tests I perform say the server IS setup to use .143, except the `re-check configuration’ utility and whenever I go to make a new server it shows the .132.

The site actually resolving with how I have it set up shows port forwarding is working correctly. The curl commands I listed above to test my public IP address show that I have my one-to-one NAT set correctly as well. I just have to be extra carful when crating servers since I always have to set the external IP address manually right now when creating new servers.

I have been told before that I did not provide enough information, so I think this is an OK balance. :slight_smile:

So, you have an extremely unusual configuration, where the outgoing requests are going out a different IP than the one you’re forwarding to the Virtualmin server.

You know better than Virtualmin in this case. The way we detect this is we send out a request to an IP checker (this is the only way to detect an external IP, without being explicitly told what it is). Since you know better, you should set your IP in the Virtualmin config to the one that you know you’ll be using for incoming traffic.

no, I have it setup for everything to come in and go out on .143 (which is working)

the curl commands I run for getting the public ip address responds that I have it set correctly for .143

Virtualmin is reporting that it is .132

All of my settings I have for incoming and outgoing are set for it to be for .143 but virtualmin is reporting it is seeing / detecting .132

I hope this is a little clearer.

This part confuses me. Easy enough to do. I’ve only used port forwarding when I was splitting ports over different internal addresses. Say file sharing to one machine ( and web traffic to another ( With 1 to 1 nat, I’d think you open some ports which is different than forwarding.

I have a /27 block of static IP addresses, the first useable address .132 is assigned to the router for everything to go out of the router as .132 unless you use 1 to 1 nat to use another IP, which I am using .143 for this setup.

I am using both 1 to 1 nat so the system goes out on .143 and port forwarding so it comes in on .143.

The setup is working for this, what is NOT working is how Virtualmin is detecting what the external IP should be.

Again, the way I have everything set up and working is functional, the ONLY issue I am experiencing is Virtualmin is detecting a different external IP than I have setup to use and is functioning like it should.

The ONLY issue is Virtualmin is not detecting the external IP correctly, and this is causing me to have to modify address settings so when I create servers for it to use .143, NOT .132 since the firewall and system is NOT setup to run off of .132

It is saying it sees the external IP as .132, when I have everything configured to go in and out as .143, which it is doing.

I hope the issue I glitch / issue I am seeing is now more evident.

I’m out after this. I don’t know your system. That said, I don’t think you should be using both NAT and Port Forwarding. My guess, and it is only a guess, that the Port Forwarding is happening before the NAT, so NAT isn’t really happening and you are Port Forwarding from .132 so that is being picked up. Again, only a logical guess, but still a guess.


I am having the same issue. What happened with my setup is that I have two NICs on my box, and during the install I forgot to disable the management NIC, and Virtualmin picked that NIC to route traffic through. I disabled the NIC that I didn’t want Virtualmin using and re-ran the Re-Check Configuration option. Virtualmin is still detecting the external IP of the disabled NIC even though traffic is all now being routed in and out of the correct NIC. Not sure why it won’t pick up the currently enabled NIC’s external IP.

For me, I found just found an old thread that talks about how detection of the external IP is only run at virtual server creation/migration. I went to Manage Virtual Server > Change IP Address and found that the external IP address was set as the wrong one. I changed it to the correct one, and now Re-Check Configuration shows the correct external IP address.

That’s surprising. I would have thought Re-Check Configuration would also detect it. Seems bug-like.

I did this again, to show no updates are needed, and now I am not getting the error.

Yes, it is working as it needs to now, the most infuriating part is that I did that already (the first thing I did) so I did not ever think to do it again especially since I knew it would come back as “nothing to update”

I greatly appreciate you posting this and giving me the benefit of a DOUBT that there really was/is an issue.

Thank you! :smile:

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.