INF: Replication Setup Over a Firewall

ID: Q164667


The information in this article applies to:


SUMMARY

If you are setting up replication and there is a firewall between the servers involved in replication, the servers need to be set up properly to communicate with each other over the firewall. This article details the steps required to enable the servers to listen on specific ports for Multi-Protocol traffic and to enable the servers to talk to each other on these specific ports.


MORE INFORMATION

Client-Server Communication Over a Firewall

Setting up a client to communicate to a SQL Server over a firewall is a simple three-step process:
  1. Make SQL Server listen on a specific port on TCP (the default is 1433) or RPC (the default is a random port greater than 1023). You have to cycle the server after this change.


  2. Configure your firewall server to allow traffic on the specific <ip_address><port_number>.


  3. Make the client (on the other side of firewall) use the appropriate connection string to talk to the <port_number> on the server. You can also use the Client Configuration Utility to add an "Advanced" entry with the appropriate Net-Library and connection string.


Replication and Secure Network Libraries

Because replication uses trusted connections, it requires a secure Net- Library. Therefore, TCP/IP is not a viable option. Only the Named Pipes or Multi-Protocol (RPC) Net-Library can be used. SQL Server version 6.0 used a random port for the Multi-Protocol Net-Library; SQL Server version 6.5 provides an option to specify a pre-selected port for RPC traffic.

Replication Set Up Over Multi-Protocol Net-Library with a Specific Port

Because replication makes one server act as a client to the other, the steps below must be done on both servers. Before proceeding, note that the following assumptions have been made:
You will have to enable both servers to listen on the Multi-Protocol Net- Library using the SQL Server Setup Change Network Support option (and cycle the server for this change to take effect). To establish RPC connectivity using specific ports between the two servers, perform the following steps:
  1. On Server1, add an entry in the Windows NT registry so that SQL Server listens for incoming connections on the specified port. Use Regedt32.exe and navigate to the following registry key:
    
          HKEY_LOCAL_MACHINE
             \Software
                \Microsoft
                   \MSSQLSERVER
                      \MSSQLSERVER
                         \RPCNetlib
     
    Add a new value named "RPCprotocols" with a value type of REG_MULTI_SZ To the RPCNetlib key. For the value, enter the string "ncacn_ip_tcp,1500". Note that there is no space between the comma and 1500 (the port number). For more information, refer to the "Custom Server Configuration Using the Multiprotocol Networking Library" section (pages 123 and 124) in the "What's New in SQL Server 6.5" in the SQL Server documentation.


  2. On Server2, use the Client Configuration Utility to add the following "Advanced" entries:

    This connection string forces the replication-related processes in the SQL Executive to use the specified <ip_address> and <port_number> to connect to the specified server. For more information on using the SQL Client Configuration Utility and on Multi-Protocol connection strings, refer to Chapter 4 (pages 88-89) in the "SQL Server Administrator's Companion".


This completes the one-way setup of Multi-Protocol communication between the two servers (Server2 talking to Server1). Now, repeat the steps above with relevant <port_number> and <ip_addresses> for Server1 to talk to Server2:
This completes the setup for SQL Server replication over a firewall using the Multi-Protocol Net-Library.

Additional query words: repl ipc config netlib net-lib


Keywords          : kbsetup kbusage SSrvNet_Lib SSrvRep 
Version           : 6.5
Platform          : WINDOWS 
Issue type        : kbhowto 

Last Reviewed: April 9, 1999