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.
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.