Score:0

EC2 outbound static IP

in flag

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?

Michael Hampton avatar
cz flag
Why do you think that your outbound traffic uses a different IP address? You did not explain this in your post.
bocian85 avatar
cn flag
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 )
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.