After installing SQL Server 2008 R2 on a Windows 2008 server you will need to configure the firewall (if it’s turned on!) to allow access to the SQL server. Here is the simple method using the interface and assumes the following:
- The SQL Instance is the default (first installed)
- The ports have not been manually configured
- Nothing too exotic like database mirroring is required.
- Open the Firewall either from the Control panel
or by running WF.msc - There are 3 default firewall profiles. One or more can be active depending on what and how you have configured your NICs. You will need to ensure you are editing the correct profile. Here you can see that mine is on a domain, so my Domain Profile is Active.
- Select ‘Inbound Rules’ in the left hand pane.
- Click on ‘New Rule…’ in the right actions pane.
- select Port Rule Type and click Next>
- Set TCP and Specific local Ports to 1433 and click Next>
- Leave the default of ‘Allow the connection’ and click Next>
- If you don’t ever want SQL to be directly accessible on a Public network (assuming you are going to ever connect your SQL server directly to the internet for some reason!!) then un-check the ‘Public’. Otherwise just click Next>
- Name it SQLPort and give it a description and click Finish.
That will enable inbound connections to your SQL Server. If you are also enabling SQL Browser Service then you will need to add UDP Port 1434 too another inbound rule.
If you have more than one instance of SQL then you will need to set the port and create rules for them.
For full details on ports and setting it up go to http://msdn.microsoft.com/en-us/library/cc646023(v=SQL.105).aspx