On 12/23/18 8:21 PM, Grant Taylor wrote:

Can the phone server in A talk to a system in B?  Or does the magic need to happen on a multi-homed host that is in both the Voice VLAN (A) and data VLAN (B)?

Yes, I control the router, poking a hole allowing port 25 from the phone server IP to the mail relay IP is trivial. This would lessen the need for a multi-homed server - although that is possible too as the infrastructure is virtualized.


I've never had to deal with a server in this manner before... needing to go through a different vlan/vpn. Hence my thought of a mail relay.

I believe the mail relay, particularly if it's multi-homed in both voice and data VLANs, is a viable option.

I was messing with source and destination nat but because of the site vpn addressing, and the phone server not being in that address range... I'm pretty sure that's why it wasn't working.

Depending where you do it, I would expect that the NAT would work.

Hypothetical scenario:

Voice VLAN = 192.0.2.0/24
Local Data VLAN = 198.51.100.0/24
Remote Data VLAN = 203.0.113.0/24

I'm guessing that you need to get voice messages as attachments from the VoIP PBX, 192.0.2.123, to the corporate email server, 203.0.113.234. The problem is the site-to-site VPN only allows 198.51.100.0/24 and 203.0.113.0/24 to communicate.  Meaning that the site-to-site VPN won't pass traffic from the VoIP PBX.

Here's an important question:  Does the VoIP PBX have a default gateway configured?  Or does it /only/ know about the voice VLAN, 192.0.2.0/24? Because if it doesn't have a default gateway, then (what it knows as) the mail server will have to be local to the voice subnet.

We already know that the local side of the email solution will have to be in the 198.51.100.0/24 subnet to bee able to use the VPN.

You could probably fairly easily have a multi-homed host that is in both the Voice VLAN, 192.0.2.252, and the Local Data VLAN, 198.51.100.252.

That would allow you to run an MTA on the multi-homed host and forward email at the SMTP application layer.

That would also allow you to use NAT to translate the SMTP traffic as it passes between the VoIP PBX and the corporate email server.

Let's say that eth0 is in the Voice VLAN, 192.0.2.252, and that eth1 is in the Local Data VLAN, 198.51.100.252.

# Traffic from the VoIP PBX to the corporate email server.
iptables -t nat -A PREROUTING -i eth0 -s $PBXIP -d 192.0.2.252 -p tcp --dport 25 -j DNAT 203.0.113.234 iptables -t nat -A POSTROUTING -o eth1 -s $PBXIP -d 203.0.113.234 -p tcp --dport 25 -j SNAT 198.51.100.252

# Traffic from the corporate email server to the VoIP PBX.
iptables -t nat -A PREROUTING -i eth1 -s 203.0.113.234 -d 198.51.100.252 -p tcp --sport 25 -j DNAT $PBXIP iptables -t nat -A POSTROUTING -o eth0 -s 203.0.113.234 -d $PBXIP -p tcp --sport 25 -j SNAT 192.0.2.252

That should get quite close to what you need.  That alters both the source and destination IP addresses as the traffic passes through the multi-homed host, in each direction.

Aside:  I call that "Double NAT" because it NATs two different addresses on one device (as two distinct operations).  But the rest of the world thinks "Double NAT" is something else.  :-/


So it basically comes down to picking a package and then locking it down so it only forwards mail to that specific IP, and only allows mail to be received from the phone server.

It would be easier to use the public IP but due to regulations it has to go over the VPN.

Dan

Reply via email to