Exchange admins working for medium to large companies would have come across the process of “Collapsing the DAG Network”. This is very important in deployments where there are no stretched subnets across datacentres. In this case, Exchange will pick up four DAG networks (one MAPI and one replications subnet per datacentre). Collapsing these four subnets into two (one MAPI and one replication) is important in making sure that the replication traffic is routed through the replication network. Otherwise, irrespective of whether you have a dedicated VLAN for replication or not, Exchange will always use the MAPI network.
Let me explain with an example. We have a DAG named DAG1 across two datacentres and there is no stretched subnets or VLANs. Hence, Exchange will create a DAG network for each subnet it finds. The below table shows the four subnets we have.
The 192 subnet represents the production network (MAPI) and the 10 subnet represents the dedicated replication network.
In order to collapse and tidy up the DAG networks, we need to run the following commands.
Set-DatabaseAvailabilityGroupNetwork DAG1DAGNetwork01 -Subnets 192.168.100.0/24,192.168.200.0/24
Set-DatabaseAvailabilityGroupNetwork DAG1DAGNetwork02 -Subnets 10.0.1.0/24,10.0.2.0/24
Now, lets rename the networks from DAGNetwork01 & 02 to something meaningful, like MAPI and Replication.
Set-DatabaseAvailabilityGroupNetwork DAG1DAGNetwork01 -Name MAPI
Set-DatabaseAvailabilityGroupNetwork DAG1DAGNetwork02 -Name Replication
The following command will disable replication traffic through the MAPI network.
Set-DatabaseAvailabilityGroupNetwork DAG1MAPI –ReplicationEnabled $false
These commands will come in handy if you are scripting your Exchange deployment, a common practice in large organizations.