Ec2 instance opened port not connecting from certain regions - sql-server

I have installed SQL Server in an AWS instance (Ubuntu) and it is working perfectly but found that it is not able to connect to the database from certain IPs (from that region not working for any ISPs). My port 1433 is open and I am able to access it from my system. Here is my security group configuration:
But in my friends system which is in a different network it is not connecting though I can access port 80 from that system. I telnet that port (1433) and it is throwing "could not connect host". I tried tracetcp and after 9 hops the requests are timed out. I used VPN in that system and it got connected.
Not able to determine what could be the issue. Not a network pro and any help is highly appreciated.

Related

All but one Windows 11 Surface Tablet can make remote connection to SQL Server

I have SQL Server Express 2017 running on Windows Server 2016 Standard (default instance, not named). It has remote connections enabled and is listening on port 1433 and has TCP/IP and Named Pipes enabled. I have several Surface Tablets running Windows 10 and Windows 11. These tablets make a VPN connection to the server to connect to SQL Server. All of the tablets, except one of them, can connect to SQL Server. All tablets connect using the server's IP address and with SQL Server Authentication. All tablets are connected to the same WiFi router - both the ones that CAN connect and the one that CANNOT, so I believe router settings are not the problem.
The tablet that fails to connect can ping the server successfully. It cannot, however, telnet to port 1433 on the server - this times out. All other tablets can make the telnet connection. Also, using sqlcmd to connect (sqlcmd -S ip-address -U user-name -P password) works on all tablets except the one. This returns error 53. Checking the SQL Server logs after attempting to connect using sqlcmd shows no errors. So this tablet is definitely not even reaching SQL Server.
I have disabled all Windows Firewall options on the tablet with no change - still cannot telnet or connect via sqlcmd.
I have walked through multiple remote connection troubleshooting guides step by step, but most of them assume that NO remote systems can connect to SQL Server. In this case, it is just one system. So I know that the server is configured properly to allow remote connections. I just cannot determine what is different about this one tablet that is preventing it from making a connection.
What might be preventing this one system from making this connection? Any settings or other options I should be looking at?
SOLVED: After performing tracert on multiple systems that connect to this server including the problem tablet as well as attempting to telnet to various ports at the server's IP address, I discovered that the WiFi network that the tablet was on had a conflicting IP address with the server. The previous tablets that tested fine were, unbeknownst to me, on different wifi networks that did not have this conflict. As a result, this tablet was attempting to connect to a completely different device despite being properly connected to the server's network via VPN.
So the additional piece of advice to add to this troubleshooting process would be to very closely scrutinize the output of ipconfig /all. Even though you may be connected to the network of the SQL Server system you are trying to connect to remotely, if the IP of the SQL Server system is duplicated on your local network, it can be very difficult to see that all of your connection attempts are actually routing to a different system - that is why the connection is failing.
What to look for in ipconfig /all... check the client system's IP address and the default gateway that it is using. If these are using private IP addresses (as most do) most commonly starting with 192.168.x.x, and you are trying to connect to SQL Server over VPN via which the server also has a private IP address, check if your local subnet is matching the server's subnet. For instance, both the client (tablet) subnet and the server subnet were 192.168.20.x There's a chance for an IP address conflict in these conditions.
Another check that I found was helpful was, on the client, to DISCONNECT from the remote server and then try to ping the SQL Server IP address. If the ping succeeds, the server's IP address is being duplicated by another system.

How to connect other system to my localhost port in signal R

I have tried using localhost in my wpf application it works only for local .. i need to create a hub server where other system should be connected in this server..i have tried allowing the port in inbound and outbound rules in firewall which is mentioned in stackoverflow..
my two systems where connection in same network domain.. when i tried giving my ip address in creating hub server .. it throws exception..
Please help me on this..

Unable to telnet to SQL mirroring port on public IP on Azure ARM VM

I am trying to mirror a on premise SQL database to Azure ARM VMs running SQL server. One for the mirror and one for the witness. I have setup the mirroring end points on the servers. However, I am getting an error to the effect that the mirror server can not be reached.
Reading through the net pages, I tested the port using telnet. I am able to telnet to the mirroring port on my local server from the Azure VM but unable to telnet from the local server to the VMs.
I am able to telnet on the mirroring port between the VMs using the Private IP Address but unable to do so using the Public IP address.
I have added the port to the Security group being used by these VMs to allow inbound connections as well as outbound connections.
I have tested that the server is listening on ip 0.0.0.0 and my mirroring port.
Any help would be very much appreciated.
For whatever its worth, I was setting the Inbound connections source port range as the port I was going to use for mirroring. I changed this to "*" and it started working.

Azure - Network Path Not Found

I have 4 Azure VMs which are part of the same resource group and virtual network. 3 of them are running SQL Sever and 1 of them is configured as a domain controller. The 3 SQL VMs are getting there DNS from the DC.
The VMs can log into the domain and see each other on the network. When I try to use connect to SQL instances across the virtual network, however, I receive a network path not found error.
I have renamed the instances and even tried removing and re-installing them. So I am sure it is a network issue, and not a SQL Server problem. I also can't connect via IP address, so it doesn't seem to be DNS.
The instances are all default instances and are connected on 1433, the VMs all have TCP 1433 endpoints and Windows Firewall is turned off.
I think you need to Enable the Port from Azure Services As well
The instances are all default instances and are connected on 1434, the
VMs all have TCP 1433 endpoints, and Windows Firewall is turned off.
Ensure you have both ports open in all machines. 1433, 1434
Also remember that disable windows firewall is just a temporary thing, you should re-enable it once the connection test pass.
Note that depending of your kind of connection/services you also should open:
1433: / TCP / UDP
80: For sync over HTTP / TCP
443: SQL Server default instance running over an HTTPS endpoint / TCP
4022: Service Broker / TCP
135: Transact-SQL debugger / TCP
7022: Defacto database mirroring / TCP
2383: SQL Server Analysis Services
2382: connection requests to a named instance of Analysis Services

Can't connect to EC2 SQL Server unless I open to all IPs

Strange issue. I have SQL Server running on an EC2 box that I can connect to remotely fine if I open up all IPs (0.0.0.0/32) for port 1433. If I just open up for the IP I'm connecting from then it I get a connection error. I can't even ping the server on port 1433 (using paping) unless I open up to all IPs.
The IP must be right because I have a rule that opens up just my IP for port 3389 to connect using RDP, and that works fine.
Any help would be appreciated. I'm probably missing something simple. Thanks.
As per my experience connecting to SQL server running on EC2 box from my desktop, I had observed that you need to make 2 entries with same IP and port number detail, one for TCP and other one for UDP protocol. Try if that works for you.

Resources