I am setting up a server with contabo and I have it set to two IPs
This is my netplan which I have altered in a attempt to not put myself on blast.
network:
version: 2
ethernets: # Define an Ethernet interface (eth0 in this case).
eth0:
match:
macaddress: "01:70:76:77:81:3c"
addresses: # Assign multiple IP addresses to the interface.
- xxx.xx.x.359/21 # Website's IP address (primary).
- xxx.xx.x.360/21 # Email server's IP address (secondary).
nameservers:
addresses:
- 'xxx.xxx.xx.xx'
- 'xxx.xxx.xx.xx'
- 'xxxx:xxxx:xxxx::x:xx'
set-name: "eth0"
routes:
- to: default
via: 219.69.0.1
- on-link: true
to: default
via: fe80::1
I want mailcow on one ip and the website on the other. I am running wordpress website via nginx. Do you have advice other than how I should run the mail server on a different server? I was going to use the docker container version of mailcow. I have hit a brick wall as I am lost in the sauce. I was woundering if anyone else has attempted to do this.
So to simplify I am running a contabo virtual server with 2 ips running a wordpress site via nginx. One Ip is running the website and the second IP I want for the docker mailcow.


You can bind an exposed port to a specific IP by prefixing the IP address like this “-p xxx.xx.x.360:80:80”. Should work in a compose file “ports” list as well.
For outgoing traffic it’s a bit trickier, but if you create a separate network I think it should be possible to inject an iptables SNAT rule to use a specific source IP. Might be handy to make sure you’re sending emails from the correct IP but with your setup I would just make sure to use the primary IP as email egress…