Multiple Interfaces on Different Networks

Jun 12, 2023
Hello, we are trying to set up multiple network adapters/interfaces on two different networks to act as an SMTP relay. Here is an example:

Interface/adapter ens192
Gateway (IPv4):
Services: web interface, SMTP relay on port 25

Interface/adapter ens224
Gateway (IPv4):
Services: SMTP relay on port 25

We first tried to do this in the PMG web interface, however, Debian doesn't allow multiple gateways to be added in /etc/network/interfaces. We also tried to add the routes in that configuration file by doing the following:
#auto ens224
#iface ens224 inet static
# address
# post-up ip route add dev ens224 src table mgmt
# post-up ip route add default via dev ens224 table mgmt
# post-up ip rule add from table mgmt
# post-up ip rule add to table mgmt

It seems that PMG web interface would default to the address, and we also had intermittent issues with SMTP responding on both and at the same time.

Is there a way for us to make this work or would we need to redesign our setup?

Thank you.
What are you planning with the 2 interfaces?
The core issue here is that it's not (easily) possible to define 2 default gateways - and usually this is not necessary

If you want to reach a particular set of networks through ens224 and the rest through ens192 (or the other way around) - the way would be to put the default route on ens192, and add the particular networks as routes (in post up commands) to ens224

the postfix config should work with multiple configured IPs (although it's been a while since I last tried that)

I hope this helps!
Thank you for the quick response. Here is what we are trying to do:

ens192 ( will be the primary and "permanent" IP address of the new PMG server.

ens224 ( is currently assigned to a different server running a legacy SMTP relay. Due to the number of clients manually configured to use as the SMTP relay, we want to move that IP address over to the new PMG server, so that those clients continue to work until the time comes when we can update them all to use
In this situation I would:
* configure your routers to route to and configure as alias to ens192

I hope this helps!


The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!