Multiple Interfaces on Different Networks

Jun 12, 2023
2
0
1
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
IPv4/CIDR: 192.168.1.99/24
Gateway (IPv4): 192.168.1.1
Services: web interface, SMTP relay on port 25

Interface/adapter ens224
IPv4/CIDR: 10.10.0.99/16
Gateway (IPv4): 10.10.0.1
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 10.10.0.99/16
# post-up ip route add 10.10.0.0/16 dev ens224 src 10.10.0.99 table mgmt
# post-up ip route add default via 10.10.0.1 dev ens224 table mgmt
# post-up ip rule add from 10.10.0.99/32 table mgmt
# post-up ip rule add to 10.10.0.99/32 table mgmt

It seems that PMG web interface would default to the 10.10.0.99 address, and we also had intermittent issues with SMTP responding on both 192.168.1.99 and 10.10.0.99 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 (192.168.1.99/24) will be the primary and "permanent" IP address of the new PMG server.

ens224 (10.10.0.99/16) is currently assigned to a different server running a legacy SMTP relay. Due to the number of clients manually configured to use 10.10.0.99 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 192.168.1.99.
 
In this situation I would:
* configure your routers to route 10.10.0.99 to 192.168.1.99 and configure 10.10.0.99/32 as alias to ens192

I hope this helps!
 

About

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!