Exchange 2010: Loadbalancing Relay Connector

Exchange Logo

On an Exchange 2010 environment I needed to allow smtp relaying for specified hosts. The procedure for doing this is explained clearly in the Exchange 2010 documentation.

So I created a relay connector on all servers with the HT role and since we are using Virtual Loadbalancing appliances from LoadBalancer.org to loadbalance the HT and CAS roles I wanted the relay connectors to be loadbalanced as well.

So how do we configure this?

In this example I will use the following configuration

IP Port Comment
10.1.1.17 25 Floating IP
10.250.1.18 25 Exchange HT Server 1
10.250.1.19 25 Exchange HT Server 2

image

On the LoadBalancer VA, go to Edit Configuration | Logical Layer 4 Configuration | Virtual Servers | Add a new Virtual Server:

image

Then add the real servers to it, example:

image

 

image

On the Exchange HT Servers, first add the Microsoft loopback adapter by starting hdwwiz from the startmenu:

image image
image image
image image

 

Rename the new Network connection to Loopback, go to Properties and remove all except TCP/IPv4 and configure it with the floating IP address and netmask 255.255.255.255:

image image

On the Relay Connector change the Connector Bindings to both the Floating and the Real IP:

image  

Now disable strong host Sends and Receives on the Loopback Interface:

image

Finally disable strong host Receives on the Real Network Interface:

image

In this configuration Exchange will see the real client IP so we can use the Remote Servers tab to identify the IP Addresses that are allowed to relay:

image

We must ensure of course to add the IP’s to all Exchange HT servers, so I wrote a small PowerShell script for it:

foreach ($recvConn in Get-ReceiveConnector | where { $_.Name -like "Relay*" } )
{
	$ranges = $recvConn.RemoteIPRanges
	$ranges += "1.2.3.4"  #The Address to add
	$recvConn | Set-ReceiveConnector -RemoteIPRanges $ranges
}

Was once an enthusiastic PepperByte employee but is now working elsewhere. His blogs are still valuable to us and we hope to you too.