Using a Public IP, Floating IP, Static IP not tied to box

If you’re concerned about using ephemeral IPs, and have reserved a static IP from your provider (sometimes called floating IPs, elastic IPs, etc), the odds are your MIAB does not see it, and yells at you.

  1. use floating IP on ‘glue records’ / global dns
  2. set the PRIVATE network interface to be the gateway for outbound traffic. Digital ocean command below
  3. rerun mailinabox and you’ll get a prompt to enter the public IP. Replace the node’s IP with your static IP.

That’s it! config will detect the network card as private, show private and public IPs, and stop yelling at you in status checks.

# BOO Wrong IP
root@box:~# ip -o route get to | sed -n 's/.*src \([0-9.]\+\).*/\1/p'
# grab private gateway IP (likely 10.10.x.x) and set as default gateway
curl -s | xargs route add default gw
# YAY correct private IP
root@box:~# ip -o route get to | sed -n 's/.*src \([0-9.]\+\).*/\1/p'
#Yay now all apps use correct outbound rout, and internet sees our floating IP
root@box:~# curl ''

Regardless of provider, MIAB will see both IPs correctly once default gateway route add default gw [IP] is set.

Primary Hostname:
Public IP Address:
Private IP Address:
Mail-in-a-Box Version:  v55

Hope that’s helpful to anyone else who runs into this issue!

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