0

I'm having troubles with an EC2 server

I need to connect with an external SQL server that has whitelisted an elastic IP attached to the instance. All the security rules and routes are set in the most permissive way. However, the outbounding traffic from my EC2 seems to have another IP.

The output

sqlcmd -S <SQLServerIP> -U <User> -P 
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x102.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if the instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

How can I fix it?

Prajna Rai T
  • 149
  • 5
sandalija
  • 1
  • 1
  • 2
    Why do you think that your outbound traffic uses a different IP address? You did not explain this in your post. – Michael Hampton Jun 14 '21 at 13:47
  • you can check the outbound traffic IP by doing `curl ifconfig.io` , also `tcpdump` and the target host will also show the IP you can check if the connection really works omitting the sqlcmd (confirm the firewall / network issue) by trying `telnet SQL_HOST 1433` which connects to the TCP port 1433 of the target machine ( you quit telnet by doing ^] and then q and pressing enter ) – bocian85 Jun 14 '21 at 21:45

0 Answers0