SQL SERVER 2012 Database: Open firewall causes external connection to database workaround

Source: Internet
Author: User

SQL SERVER 2012 Database: Open firewall causes external connection to database workaround

Save the following code as a Opensqlserverport.bat file :

netsh advfirewall firewall add rule name= "Open Port" Dir=in action=allow protocol=tcp localport=80

@echo ========= SQL Server Ports ===================

@echo Enabling SQL Server default instance port 1433

netsh advfirewall firewall add rule name= "SQL Server" Dir=in action=allow protocol=tcp localport=1433

@echo Enabling dedicated Admin Connection port 1434

netsh advfirewall firewall add rule name= "SQL Admin Connection" Dir=in action=allow protocol=tcp localport=1434

@echo enabling conventional SQL Server Service Broker Port 4022

netsh advfirewall firewall add rule name= "SQL Service Broker" Dir=in action=allow protocol=tcp localport=4022

@echo Enabling Transact Sql/rpc port 135

netsh advfirewall firewall add rule name= "SQL debugger/rpc" Dir=in action=allow protocol=tcp localport=135

@echo ========= Analysis Services Ports ==============

@echo Enabling SSAS Default Instance Port 2383

netsh advfirewall firewall add rule name= "Analysis Services" Dir=in action=allow protocol=tcp localport=2383

@echo Enabling SQL Server Browser Service Port 2382

netsh advfirewall firewall add rule name= "SQL Browser" Dir=in action=allow protocol=tcp localport=2382

@echo ========= Misc Applications ==============

@echo Enabling HTTP Port 80

netsh advfirewall firewall add rule name= "HTTP" Dir=in action=allow protocol=tcp localport=80

@echo Enabling SSL port 443

netsh advfirewall firewall add rule name= "SSL" Dir=in action=allow protocol=tcp localport=443

@echo enabling port for SQL Server Browser Service ' s ' Browse ' Button

netsh advfirewall firewall add rule name= "SQL Browser" Dir=in action=allow protocol=udp localport=1434

@echo allowing multicast broadcast response on UDP (Browser Service enumerations OK)

netsh firewall set multicastbroadcastresponse ENABLE

Then run the file at the cmd command prompt.

After testing is very good, and does not affect the opening of the firewall, reprinted http://blog.csdn.net/aminfo/article/details/21470449.

SQL SERVER 2012 Database: Open firewall causes external connection to database workaround

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.