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